Set Orientation Lock in App not working

I have a simple Shortcut Automation on my iPhone 13 (iOS 15.4) to “Set Orientation Lock” On when the app is opened and then another automation to turn it off when the app is closed, but the turning on one doesn’t work. I’ve tried swapping apps and other apps work, but this particular app called iBreviary doesn’t. The other automation to to turn orientation lock off does work though. Weird bug? Is it likely to be the app or shortcuts or the os?

What happens in that app when you manually (not through Shortcuts) set the rotation lock?

It does lock. And the second automation to unlock when quit works fine.

Okay, so that tells you that the app does respond to the operating system setting when it is set.

You know it only affects one app, and it only affects it when setting the rotation lock, from Shortcuts when opening that app and triggering the lock in Shortcuts.

I am assuming now that the issue is specifically that the mode is not changing rather than the app not respecting it. We know it is not overriding it as it can be manually applied. So, I think this leads to the question of is the trigger not triggering or is the action not being triggered.

What happens if you add a step to play a noise or display a notification when setting the rotation lock on through your automation? Does the additional step also occur when launching this other app? Does the order of before or after the orientation lock step make any difference?

Thanks for your help.

So I added a step to display notifications and then opened the app. The notification displayed and the lock engaged. So I took out the notification step and tried again and the lock engaged. I will have to see if the behavior remains in the future, but that appears to have fixed something.