I tried this with an environment variable that was marked secret, and the script threw the same error as if the variable is not created at all.
I also noticed a similar issue when I wanted to specify the empty string for one environment.
Let me know if these scenarios should be working or not. Thanks.