Recently ran into a problem where a client had been migrated from an in house exchange server to Office 365 email.
After the migration the outlook clients kept switching back to the in house exchange server even though there was an external DNS autodiscover record and an internal cname autodiscover pointing to the external dns record.
We fix this by removing the following two attributes from the users AD account. homeMDB and homeMTA
After removing the account we were able to run repair in outlook and it reconnect to the correct server.