Have you tried new batteries?
Frankly, I don’t understand the Sonos response, as long as the remote has been set up for use as an IR remote, it should be working.
I’d double check that it’s still set up for using IR, though. I’ve seen updates to the TV set’s firmware that have switched off the IR function, so it still communicates with the TV set, but no longer sends an IR signal…..but that seems like an unlikely thing, since you’re saying it works on the Sonos if you stand up in front of the TV. So I’ll stick with my “batteries” suggestion :)
I had changed the batteries with no luck, as well as reconfigured the remote as Bose, Panasonic, Sonos, etc. with the same result, it worked, but only if I stood there to bounce the signal off. Weird. But I did just find this post that seems to have fixed it. The extra step of doing the power test, saying it didn’t work, redoing the power test and then saying it worked, seems to have worked. No idea why, maybe it cycles the type of remote, or signal or something…? But I’ll link the solution that seems to have worked in case someone else comes across this post.
https://us.community.samsung.com/t5/QLED-and-The-Frame/Can-no-longer-control-Sonos-sound-bar-optical-cable-via-remote/td-p/1551351