Shortcuts Can't Change Appearance While Phone is Locked

Hi,

I’m trying to work out if something is a bug or a “feature”.

I have a Shortcuts automation which changes the appearance to dark when Do Not Disturb (DND) is enabled, and another which changes appearance to light when DND is disabled.

It works as expected when I manually toggle DND, but if I set DND for a time period (eg: 1 hour), the automation fails to change the appearance if it runs while the phone is locked.

I was wondering if this was the case for others, and if there are any workarounds? I understand Apple restrict certain actions when the phone is locked for security reasons, but I’m struggling to see the security risk of changing the phone between light and dark mode, hence why I’m wondering if I’m missing something silly!

Note I’m trying this on an iPhone, so the behaviour may be different on the iPad.

Daniel.