This is a BUG (or maybe a feature requested by Microsoft?) in Outlook - if you register your domain on Microsoft 365, Outlook Autodiscover for MAPI ALWAYS tries to connect to Microsoft 365 and won't connect to other services.
You can avoid this with a mod in the Windows registry that tells Outlook NOT to use Microsoft 365 with the Autodiscover service.
At the moment I don't have a tutorial to do it, I will post it later if I can (but you can find it by searching the community ...)
Gabriele Maoret - Head of SysAdmins at SERSIS
Currently manages 6 SmarterMail installations (1 in the cloud for SERSIS which provides services to a few hundred third-party email domains + 5 on-premise for customers who prefer to have their mail server in-house)