That's not actually how HDMI-CEC works. HDMI-CEC switches aren't KVM switches that only do HDMI.
An HDMI-CEC switcher box (or devices with that functionality built into them, like many soundbars) doesn't act as its own isolated sub-HDMI-CEC bus, where the switch presents to its downstreams as the root HDMI-CEC device, catching (without bubbling) <Active Source> messages from said downstreams, selecting one downstream to be active in an internal sense, and then presenting itself to its upstream connected TV or what-have-you as if it's one leaf-node source whose video+audio signals just-so-happen to be those of the currently-selected downstream.
Rather, at an HDMI-CEC level, an HDMI switch is a lot more like a USB switch: it passes through all the CEC message broadcasts from all of its downstream source devices through to its upstream receiver device (and vice-versa), sometimes also interpreting them in turn for effect; and the root host device can actually see the whole tree topology, including any switches.
(Fun fact: HDMI-CEC devices have four-step hierarchical addresses, that look like IP addresses, describing at each step the physical socket-number offset on the upstream device that connects said upstream to the given downstream. The TV is always 0.0.0.0. Whatever's plugged into the TV's first HDMI socket is 1.0.0.0. If that thing is an HDMI switcher box, then whatever's plugged into its first downstream HDMI socket is 1.1.0.0. And so on. All of these devices can see and talk to one another using these addresses, at all times. It's a network!)
Importantly, this means that if a TV is plugged into an HDMI switcher box, which in turn has several source devices plugged into it, then the TV will still be aware of, and can still hear and speak to, all the inactive sources downstream of the switcher box, not just the active one.
Which in turn means that if your TV is really stupid in the way it handles HDMI-CEC (e.g. trying to "argue" with sources about who's supposed to be active on wake, with the TV trying to force the last-active source and the source that woke the TV trying to force itself as the active source), then putting an HDMI-CEC switcher box in between will by no means improve things. They'll still be arguing, now "through" the switcher box; and the switcher box will itself be doing additional things in response to seeing these messages. Where previously you had O(N) HDMI-CEC problems, now you'll have O(N log N) HDMI-CEC problems.
But hey, at least your leaf-node sources in this tree all show up in the TV's input switcher menu! That was definitely worth making all this mess, HDMI Forum! :P