Welcome to Android Central.
Does it matter what app you're using? So this happens when using YouTube but never when using Spotify, anything like that?
Many apps won't work while the device is in Safe Mode but if you put the phone in SM and can open an app that you've noticed this happening with, does it still happen in SM?
I have an S21 U and have noticed that especially YouTube is sensitive to angular changes. For me rotating the device doesn't always produce the correct result the first time. So if I'm portrait scrolling and pick a vid, then rotate often it will stay in portrait until I've turned the phone and then turned it back. It's almost like it doesn't know what orientation it is in. I'm not saying this is right but it seems to be my normal. I'm trying to think of a time, other than while in an app that presents landscape, when it gets stuck in landscape... Maybe when I'm using Maps. Again for me, turning the device to the opposite of what I want and back again always brings it back to working.
Just to be clear about your case however, what it sounds like you're saying is, phone in use in landscape or portrait and for no reason and without tipping or tilting the phone it will just jump to the other orientation, is this an accurate description?
You say it boots you out of full screen mode, like when using YT, but don't mention if it stays this way or it's just enough to kick you out but returns to landscape? What do you have to do to return to full screen/landscape mode? Tilt it again, open the app again, something else, what does it take?
Being a member we could move this to the S21 threads where other S21 users will see it and perhaps recognize the issue. Here in the general Ask A Question area many may see it but only a few may have the device. Let's see what
@B. Diddy or
@mustang7757 think about moving this.