Is the system member of a domain? If so, was there ever an exchange in the domain (stray SCP records)? If not, check autodiscover records to be accessible (also from outside), see also https://docs.grommunio.com/kb/autodiscover.html, since O365 always uses O365 for autodiscover.
You can stop Outlook from checking Office 365 for settings by setting a registry key.
In HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Outlook\AutoDiscover, add the key ExcludeExplicitO365Endpoint of type REG_DWORD, with value 1.