`Screen.Orienation` occasionally doesn’t change as expected on some devices

I’m using code to adjust the screen orientation, but occasionally it doesn’t change as expected based on the device. When debugging, it indicates that everything is working correctly.

Screen.orientation = ScreenOrientation.Portrait;

This issue is specific to the mentioned device; I’ve tested it on two other OnePlus devices and several different devices

Device: OnePlus 9 RT 5G MT2111
Ram: 12 GB
Storage: 256 GB
Unity: 2021.3.4f1