I have tried to add the
System.Security.Principal.Windows 5.0.0
package in the new .net 8.0 maui project without this error. You can try to clean an rebuild or adding this package after migration completed.