Welcome to Android Central!
Your sensor might be bugging out. If you are just holding it in a weird position try to lock it in landscape/portait mode.
Best regards,Mikey. I hope you found what you were looking for.
Sent from my Samsung Galaxy S7 Edge SM-G935F.