It's a known issue with the object wrapper on perspective properties.
I normally use a modified version of the sanitize function from this post whenever I'm interacting with a dict or list property in a script: