This might have different reasons, we’ll collect all possible problems here.
For restricted environments, a Microsoft 365 administrator will have to consent to using the app. You’ll get an error similar to the following, if this access has not yet been granted:
To fix this issue, please contact an administrator of your company. You might be able to do this from the same screen. Here is a support article outlining the process: Approve Microsoft 365 access (optional)