Thanks for asking the Apple Support Communities for help with your iPhone Portrait Orientation. I am happy to check this out with you.
First, I recommend re-enabling the Portrait Orientation. In the Control Panel, ensure the lock is "Off", the icon will be gray with a white lock.
Then, restart the device: Restart your iPhone, iPad, or iPod touch
Once it is restarted, go ahead and turn the Portrait Orientation lock "On" again. The box will be white with a red lock. Test if the issue is resolved.
If not, I recommend reinstalling the iOS using iTunes. Please make a backup of your data prior to doing this step: You can make a backup in iCloud or iTunes using this article: How to back up your iPhone, iPad, and iPod touch
Once your data is backed up, you can reinstall the iOS using this help article: If you can‘t update or restore your iPhone, iPad, or iPod touch
Please pay close attention when you reach step 4 which says:
When you see the option to Restore or Update, choose Update. iTunes will try to reinstall iOS without erasing your data. Wait while iTunes downloads the software for your device. If the download takes more than 15 minutes and your device exits recovery mode, let the download finish, then repeat these steps.
Once your iOS is reinstalled, test if the issue is still occurring. Thanks again and have a great rest of your day.