Hello Microsoft Team
I am facing same issue in one of my client .
around 7months we are facing this issue no one from Microsoft not yet solve this issue.
when users are try to configure "outlook for android and iOS" profile HMA not working and it's giving a option manual configuration option for users and as I understand Auto Dectect not working as expected.
Mailbox hosted in Exchange on-premise and well configure HMA in Exchange server.
after verified firewall, load balancer everything we came with conclusion that problem with Auto Detect service.
Note: sometime it will work !!! but we are not when it will work :) :)
I have done several test from my side and attached the file for your information.
I don't know why Microsoft not taking seriously on this issue.