The issue is between a Sonos AMP and a Samsung smart TV - QLED (QE65Q90RA model).
The sound of the TV works fine via HDMI Receiver (Sonos Amp) but when we try switch to TV speakers, the sound switchs to speakers tv, but after 2-3 seconds it returns to HDMI Receiver automatically.
It seems a problem with the CEC commands. We tried to update the TV to last firmware, but not solved.
Also we contacted with Samsung support and for the moment there isn’t any solution.
We have used the Audio Optical to HDMI Output Adapter provided with a SONOS Beam and works good.
Then the connection is from optical output of the TV to HDMI. Further, the controls (volumen up, vol down, mute...) works good over toslink protocol.