First: I'm missing the model number of your Panasonic TV. ![]()
There multiple opportunities, why the behaviour could have changed since your first observation:
- LE 13 build -> the included libCEC was multiple updated until a recent release to fix libCEC own issues
- KODI 22.x was adopted partly to the new libCEC feature set
- TV firmware could have changed, or the cached configuration at least
- RPi5 firmware was updated
- The TV firmware became stuck in an unexpected state until the device was completely disconnected from the power supply.
- ...
That you get no response to cec-ctl --request-active-source as soon you switch to HDMI 1 is expected as the to that HDMI port connected libCEC/KODI should answer, but doesn't react on own requests. Maybe it's technical desired to prevent a loop.
But: If you get every time phys-addr: 0.0.0.0 reliable as the response as soon your TV is set to the internal tuner, then this could be used as the detection method for a script - if required yet. In my local test cases here this expected response was not stable with my TV / AVR setup, therefore I had discarded this approach like I already mentioned above. Could be different in your specific setup.
You could try to observe the CEC bus with cec-ctl -w -M as soon you can reach the SSH to look how your TV discover the environment. Could be, that your TV require some startup time until it scans the CEC activly after about 1 minute. It's not uncommon that TV firmware takes some time to start all features completely.
A requirement not met in your setup: by design, CEC devices are not fully powered down and should respond to an incoming CEC command within a maximum of about 1.4 seconds.
Whether the buttons on a TV remote are passed on to a connected CEC device depends primarily on the television's firmware - not on KODI (or any other HDMI-CEC device). It's looks like the TV collects within the about 1st minute of operation the information to decide that by self. Initiated by the connected device (libCEC/KODI) the CEC message combination <Active Source> + <Menu Status> triggers the same status - or confirms an existing one. After the minute is expired it could also be the second detection run of the TV, as RPi5 is fast but requires time to boot until KODI with all add-ons is fully started.
This could potentially explain the current behavior. We would only know for sure if we were 100 percent familiar with how the TV's firmware behaves...