URL scheme triggers script error but action works manually (Mac)

I have a simple action with just a “Define Template Tag” step (Name: dummy, Template: [[dummy]]) and “After Success” set to Archive.

When I run the action manually on a draft in Drafts for Mac, it works perfectly - the draft moves to Archive.

However, when I call it via URL scheme from an external Python script:
drafts://open?uuid={uuid}&action=ProcessingToReflectComplete

I get this error in Drafts:

Script Error: SyntaxError: Return statements are only valid inside functions.
Line number: 3, Column undefined

The action has NO Script step - just the Define Template Tag step. There’s no code anywhere that should be executing.

Why would the URL scheme trigger a script error when manual execution works fine?

Running latest Drafts on macOS Sequoia.

Possible you have more than one action with that name?

Nope. Just one action w that name.

What have you tried to troubleshoot? Can you use the same URL to call other actions?

Where are you getting this error, in the action log or as an alert?

That error can only happen if a JavaScript fails to compile, and JavaScript is only run in actions – so it’s coming from an action somewhere.