Just thought I’d chime in and say that the solution explained in n1] did not work for me.
What worked on a 2024 LG75QNED826RE (with an RF LG Magic Remote) was unplugging the Sonos Beam HDMI cable from the TV, and plugging it in again, and making sure the TV output was set to HDMI ARC.
It seems the LG TV gets confused if I plugged something else in after the Beam, like e.g. a Chrome Cast, even if it was not inserted into the TV’s HDMI ARC slot (the Beam was already plugged here). This made the TV switch to TV sound again.
Unplugging and plugging the Sonos Beam Gen 2 and again setting the TV to HDMI ARC sound output again worked. Pairing the remote to the Sonos Beam Gen 2 is not nescessary using this setup (e.g. like you’d need to do with the Sonos Playbar).
<1]:
Edit: If an admin sees this, you can mark this as a resolved question.