Starting in Outlook 2016 version 16.0.6741.2017, Microsoft has enabled a new feature called Direct Connect to Office 365. What this feature does is connect Outlook directly to Office 365 if Autodiscover is not working. This is great feature but a network hiccup may cause your mailbox to connect to Office 365 rather than your on premise Exchange, even with a valid autodiscover record.
For Direct Connect to take effect the user must have an active mailbox on Office 365 with a valid license. Typically Direct Connect would be a neat feature unless you are in the middle of a migration to 365, but a network hiccup could incorrectly connect you to 365 even though you have not completed your migration yet.
During 365 migrations Hosted Exchange or On-Premise, we recommend disabling this option from the user computer registry:
You can stop Outlook from checking Office 365 for settings by setting a registry key.
Value = 1
Then restart your computer and it should stop trying to connect to Office 365.