We have checked the issue you published, the error may be caused by the user does not have the MS 365 License, please check whether the user has a valid License in Azure AD, as shown below:
Hope this helps.
If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.