Shortcut Won't Run Unless iPhone is Unlocked

Hi all. I was not able to get this to work directly with one shortcut due to the security reasons noted in some of comments above. However, I did find a workaround that seems to be holding together. The workaround requires two shortcuts rather than one and also requires Keyboard Maestro (and I believe Hazel, or something similar, would also work).

I created one shortcut that saves a text file to a specific folder in iCloud when it is triggered. I can trigger it by voice even when the screen is locked because it must not cross the security threshold where Apple requires user intervention for the shortcut to run.

Shortcut #1

I set up a Keyboard Maestro macro to watch the folder and trigger a second shortcut when it sees the text file added to the folder. The second shortcut triggers the open garage door action. After that action is triggered, Keyboard Maestro deletes the text file and starts waiting for it to be added again.

Keyboard Maestro Macro

Shortcut #2

Shortcuts allows Keyboard Maestro to trigger the open garage door action without my intervention. I do have the Mac set to prevent sleeping when the screen is off and I’m guessing Shortcuts sees me as logged in which allows bypassing any sort of further user intervention requirements.

This is a bit MacGyvered-together but has worked for me for the last few days. Let me know if you have any questions. Thanks!