You cannot write to UserDefaults in ShieldConfigurationExtension - From this extension, it is read only.
ShieldActionExtension: Read & Write
ShieldConfigurationExtension: Only Read
I experienced the same issue.
There are other shenanigans aswell, for instance, the localized display name is invisible outside the SCE. https://developer.apple.com/documentation/managedsettings/application/localizeddisplayname
Apple is great at introducing hidden stuff like this.