I think the following command works. You just need to wait for more than 10 minutes to effect.
az feature register --namespace Microsoft.Network --name BypassCnameCheckForCustomDomainDeletion
You can check the registering status by this:
az feature list -o table --query "[?contains(name, 'Microsoft.Network/BypassCnameCheckForCustomDomainDeletion')].{Name:name,State:properties.state}"