Is this a real bug? I recently got a MacOS device for the first time, and I have been frustrated that I couldn't get my custom service to work. Just like you, the script writes to files when I run it myself, but does nothing as a service.
I've been debugging it on and off for a couple of months because I assumed I messed something up.