FYI I always keep the Effect Controls panel open next to the Project panel. While a layer is selected, if I switch to another Comp and I click in the Effect Controls panel (either in the empty space or on an effect being displayed) the Timeline goes back to the previous Comp (with the selected Layer).
I'm categorizing it as a bug because I don't think this is a behaviour the dev team was aiming for.
Suggested solution : when switching to another Comp, the Effect Controls should either display nothing (no layer selected) or remember which layer of the new Comp had been selected previously, and switch to it.