If it's any help I experienced the exact same scenario as Yoni explained at the beginning of this thread when switching from an old Samsung Plasma TV (2011) to a new one. I made the mistake of buying a cheap $20 DAC to use between the optical out of the TV and the input of my stereo and the sound was appalling, exactly as Yoni described. I have since replaced the cheap DAC with a Topping E30 and the sound is now excellent and back to where it should be.
Now that you've bumped this thread, I might as well make some comments since others may hit it. It wasn't mentioned anywhere in this thread but most AVRs have a way to show the input signal and the speakers used in output. Optical/TosLink can only carry two channels, not 5.1 content. So if you are using optical out of the TV, you are only getting two channel audio out of the TV.
Many apps (YouTube is somewhat guilty and AirPlay is obscenely guilty) try to detect the capabilities of the playback device and they will send a signal compatible with the capability of the end-device (HDMI provides this meta-data). The chosen upsampling can be awful.
I have an older Yamaha receiver with which I don't usually use AirPlay. I'm generally happy with it for bedroom music. I tried Airplay the other day and the receiver was set for ProLogic decoding. Things sound bizarre and I can't figure it out. The display shows that all speakers are in use but I'm getting sound only from the center channel. But if I set for straight decode (where I expect stereo output) I get an upmixed sound using all speakers including the surrounds.
The only explanation I can come up with is that the upmix somehow decided to make the L/R play identical sounds with the delta in the rear and the ProLogic decoder decided that mean that everything belongs in the center. But who knows. Source folding is constantly problematic. We've even seen bugs in AVRs reviewed here where source material mapping caused the performance to degrade for unknown reasons.
Back to the OPs question, fortunately my AVR has a "2 channel stereo" mode where it will refold everything itself. I think they all have this.
I don't understand some of the earlier comments. An HDMI audio extractor with digital output is a pure digital transformation. Those should be fine to use. But they won't necessarily solve the problem as the TV will still be doing the folding.
Find a used processor or AVR with HDMI eARC. The TV should pass the audio unmolested via ARC and let the processor handle it. I just bought a UMC-200 from another ASR member for $200 used. You can find similar used devices in that price range. You don't care about features other than eArc input and good SINAD out of the RCA jacks. Let the AVR/AVP do the source material folding and you should be fine.