When assigning a value for colorSpace, or maybe specifically enum values, you have to specify the type you’re using to assign the value.
So if you knew the name of the enum item you want to assign to you would add the flag type=‘string’ to the setter command or in your case I would think type=‘int’ would represent the index of the enum.
Using the type flag worked for me in Maya 2017 and newer, so I hope it would work for you as well.