I have a relatively new iPhone 10, on which the change in orientation did work initially. It suddenly stopped working a couple of weeks ago. I have uninstalled and re-installed, I have re-set the toggle re: orientation in Settings ... nothing.
Your iPhone's "Portrait Orientation Lock" (aka Rotation Lock) might have gotten turned on. Swipe down from the upper right corner to see the Control Center, and toggle the Rotation Lock icon. If that doesn't help, let us know.
Disclaimer: I don't work for HP but I like using HP's calculators.