The error HCW8001 Unable to determine the Tenant Routing Domain should not generally occur, and it may have occurred due to an issue with provisioning the tenant, or perhaps an accidental deletion of a critical configuration item in Exchange Online.
Review the Accepted Domains in Exchange Online. Generally this should include your custom domain, and the one you were initially given, for example, <domain>.onmicrosoft.com. *Also there should be <domain>**.mail.*onmicrosoft.com.
Accepted Domains can be accidentally removed, if the <domain>**.mail.**onmicrosoft.com domain was unintentionally removed, it cannot be easily added back, as the DNS records belong to Microsoft, and therefore you cannot verify the domain.
This error will occur if it cannot find an Accepted Domain in Exchange Online with the ".mail." substring, and if it does find it, the same domain with ".mail." removed must also be an Accepted Domain.
For example, if it finds "domain.mail.onmicrosoft.com" in the Accepted Domains list, it must also find "domain.onmicrosoft.com" in the Accepted Domains list.
If <domain>.mail.onmicrosoft.com is not in the Accepted Domains list, you may need to contact Microsoft support.
Otherwise a temporary workaround may be to add an accepted domain that you can verify, with the ".mail." substring. For example, <x>.mail.<domain.com> where domain.com is your custom domain that you have DNS authority over. In this way, you will need to add both <x>.mail.<domain.com> and <x>.<domain.com> to your Accepted Domains list to satisfy the Tenant Routing Domain requirement.