If you encounter this error you need to turn user consent on for Microsoft Outlook.
- Login to an administration account for Microsoft 365
- In the admin center, go to the Settings > Org settings > Services page, and then select User consent to apps.
- On the User consent to apps page, select the option to turn user consent ON.