It's possible that you might have a misconfiguration in your OAuth settings for Office 365. Take a look at this guide to make sure everything is setup properly. Specifically, make sure you check the following items:
- Enable all of the appropriate permissions in Azure for the data your app is trying to access.
- Generate OAuth credentials for your Nylas app within Azure and add the OAuth client ID and client secret to the app configuration settings in the Nylas dashboard.
- Check your manifest JSON in Azure to make sure there aren't any conflicts.
One last thing, check your Callback URI configurations for your Nylas app in the dashboard. It's unlikely this is the problem since you're able to login with other accounts, but you need to make sure that if you're using a different login flow for Office 365 that the appropriate Callback URI is listed in the Nylas dashboard.
If none of these work, HTTP 500 errors are often related to upstream email provider misconfiguration or problems. Nylas support can help you investigate the issue further.