One of these messages may be triggered because of the reason because the user's or administrator's permissions are set up improperly or not at all.
To check for potential problems with user access, Microsoft 365 admin users have access to diagnostics that may be run inside the tenant.
An administrator account for Microsoft 365 is necessary for this capability. It is not possible to use this feature with Microsoft 365 Government.
To populate the diagnostic in the Microsoft 365 Admin Center
Click on Help & Support at the bottom right corner.
You window will appear with 'How can we help' option and a search bar
Type 'Diag: Check SharePoint User Access' in the search bar and press enter.
You will get a diagnostic screen, please enter the URL of the site you are the checking the access control for, and enter the email address of the user you are checking it for.