When the "Set-SPOUser -Site $Site.Url -LoginName XXXXXX@xxx.com -IsSiteCollectionAdmin $False" script ran getting the error: "Set-SPOUser : The user does not exist or is not unique"
Whether the Login Name is a user or a group?
If a user, whether you can run Set-SPOUser command for only one site at a time?
If a group, you need to use SID of the group as the login name as the following article: How to resolve error "The user does not exist or is not unique." when use Set-SPOUser for SharePoint online?