I had to pull out my phones to see what you were talking about. Interesting results. If I understand what you are saying, if you have the phone upside down, portrait viewing of a camera works correctly until you go into settings - at which time it flips upside down. That is not what I see on either my Android or iPhone.
On my @#$%^&8 iPhone 13 with iOS 17.1.1 and app version 2.47.0 (4), the phone will not change from landscape to portrait at all if I rotate the phone upside down (charging port at the top). It stays in whichever landscape orientation it has been in. This was tested on these camera types: V2, V3, V3 Pro, V3 Pan, and OG-Tele.
On my Motorola edge+ 5G UW (2022) with Android version 13 and app version 2.47.0 (373), it depends on which camera type is being viewed. On the V2, V3, V3 Pro, and V3 Pan rotating the phone upside down would result in the entire screen being upside down. However on the OG-Tele it would do exactly as you described. While the camera was upside down and displaying correctly in portrait, clicking the gear for settings would result in it being upside down, but pressing the back arrow to go back to the camera display would result in the portrait display of the camera page being correct.