Make sure that the custom domain is not set as the primary domain in your Azure AD. You can't delete a primary domain. The primary domain is the default domain name for a new user when you create a new user. Setting a primary domain name streamlines the process for an administrator to create new users in the portal. This implicitly indicated that the primary domain could not be removed as the new user will inherit the domain or the existing users has a domain suffix associated with that domain
If the above point is covered, attend the following requirements
Before deleting a custom domain, you must make sure the following:
- Remove any user with a username, email address, or proxy address using the custom domain name
- Remove any group which has an email address or proxy address using the custom domain name
- Remove any application in your Azure AD that uses the custom domain name
--please don't forget to upvote
and Accept as answer
if the reply is helpful--