Why is my phone screen’s orientation failing to stay locked and how do I fix it?

I have a Samsung Galaxy A71 5G. This usually only happens a few times a week, but my phone seems to be very confused by kbin. I have to hold it vertically or it will switch to landscape orientation every single time. It’s annoying. Any ideas?

Thank you all in advance!

#AskKbin