I've had this issue since I bought the s21 when the phone was released. If I'm streaming video on YouTube it is very apparent. The video will stop, and it looks like it's buffering, and then after up to 30 seconds or so an exclamation point next to the wifi icon in the status bar will appear. Then it takes another 20 seconds (or more, if ever at all) before the video picks up on cellular data, and eventually wifi reconnects. It's incredibly frustrating, as it happens every 5 or 10 minutes sometimes. I've tried getting a new Sim card, resetting the network settings, switched off mac randomization. I've tried the different network configurations in developer options, like keeping the mobile data active, or choosing stability over performance, etc. Nothing resolves the behavior. My home internet/wifi (100mb/s) is through at&t, and my cell carrier is Verizon. I've even had my router replaced by at&t. My phone has all the latest updates too.
A Google search shows that it's not an uncommon complaint with samsung phones, and even my old s9 exhibited this behavior. I wish samsung could get this sorted, or give an explanation as to what is causing it. None of my other devices on my home wifi network lose connection like this. I don't know if something happens when the phone is switching between the 2.4ghz and 5ghz bands on the widely distributed at&t ac router. It's puzzling why the phone can't switch to cellular data more seamlessly when it sees the wifi connection is lost. This shouldn't be happening on a 2021 flagship phone. Come on samsung!