That's because the local and iCloud locations are two separate folders, and the Workflow action defaults to the local folder. Quoting what I wrote on the Slack in response to a similar issue:

If you're using the built-in "Run Script" action, you can only use local scripts (since the action doesn't take any options). You can be more flexible if you use Pythonista's URL scheme directly (using the "Open URLs" action). For example, the URL pythonista3://example.py?action=run&root=icloud runs the script example.py in Pythonista's iCloud folder.

This isn't something that Pythonista can change though - the Workflow devs would need to update the "Run Script" action to allow setting a root.