Here’s what happens.
When selecting shared folder in iCloud™©® Drive©®™, macOS adds a one-line header, pushing the list of files down for exactly one line. Because of that, your click lands on non-shared folder, so macOS removes 1-line header. You’re back where you started.
Every. Freaking. Time.