I have tested your code and reproduced the issue. And then I have check the source code about the SecureStorage.SetAsyc()
on the windows.
This exception was caused by var buffer = await provider.ProtectAsync(bytes.AsBuffer());
. This should be alimit of the windows native api. And the null will also throw an exception about value can't be null.
So the string.Empty and null are not supported for the SecureStorage in the maui on the windows platform. You can use the space(" ") instead of it.