macOS defaults write -data
Solution 1:
-data
is a parameter to defaults
when writing a single data value.
You're writing an entire property list in one go, so don't include this argument as part of the property list string. Remove -data
from your command and it works fine writing the entire string as the contents of the property list file.
When writing a full property list, data is encoded as hex in angle brackets as you have done.