@Miba
Internally autodiscover works fine because the devices are domain-joined and use SCP lookup.
From above information, I think you also used those domain name on Exchange on-premises. (AD account hosted on local AD, some mailboxes may be migrated to Exchange online)
You need to add those domain as accepted domain on your Exchange on-premises first.
Then, you will need to create Autodiscover record on public DNS provider for those domains, then point those DNS record to Exchange on-premises. You also need to create a certificate contains all the domain name that you need to used(such as "*.domain.com","*.domain1.com","*.domain2.com").
After that, you also need to create DNS lookup zone for those additional domain name on your DC's DNS manager. In this way, autodiscover request will could find your Exchange on-premises, then redirected to Exchange online if mailboxes hosted on Exchange online.
About the teams issue, I would suggest you confirm with the Teams side.
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.