libCEC is the underlying library which KODI currently use to provide CEC support, provided by Pulse-Eight. KODI is only a client/consumer of libCEC. The library does the CEC communication and so on.
All things that works with cec-client should also work/be possible with KODI. If threre is a difference in behavior between KODI and cec-client, then it will be an issue of one them.
If both (cec-client and KODI) behaves same, but wrong - then it indicates for an error of libCEC or the involved HDMI configuration/driver/firmware/hardware like RPi, AVR / TV ...
cec-client is nice to debug CEC messages or to send commands via script. Maybe you can see on that way if there any messages are send as soon you power off your TV. Normally your AVR should react on the message from the TV, but:
- the TV must send this message
- it must be allowed in your AVR to power off via CEC
This should be possible independent to the RPi5 behavior. If not, you have already an issue with your HDMI configuration of the TV/AVR or one of the other devices disturb the bus. In the worst case you should start with a single physical connection TV <-> AVR, then TV<->AVR<->RPi5 only and so on to check which one is the disturbing device. Hopefully not the RPi5.
Also the most propagated hint of chewitt : Power off and un-plug all involved devices. Go away and trink a coffee, tea or something like that for least ten minutes, can be a magic healing. Because that ensures that really all HDMI partners were off/reset and the handshaking is initialized new.
By the way, cec-client could also be used as a workaround during boot to power on the TV too via autostart.sh or something like that, because the CEC interface must not be occupied by another client such as KODI at this time.