I got a response from my bug report to Synology.

They suggested a workaround of putting double quotes around the key, something I hadn't tried. I had already tried single quotes around the key like this:

&key='1234-1234-1234-1234-1234'

But that had only partially worked; the full key did save, but it also saved the single quotes into the key itself, thus making the key invalid. I hadn't thought to go forward and try double quotes around the key. Turns out that fixes it.

Though instead of doing double quotes in my script (since other parts of the code which touch that string are already using double quotes as other delimiters), I am using %22 instead, which also works successfully:

&key=%221234-1234-1234-1234-1234%22
_________________________
Tony Fabris