I created a new domain for our custom site because we wanted to use the custom URL for the community. After Domain creation I created a custom URL(for the site) and in the site, I assigned the new domain as the "preferred domain".
Due to mistakes in the configuration of the domain, the provisioning has Failed. Now I want to delete this domain and recreate the same domain with the correct configuration. But Since the custom URL is being used in the site it's not letting me delete the custom URL and the Domain.
How can I delink the custom URL from the site (I tried setting the previous domain as the preferred Domain but the custom URLs delete button is still disabled as seen in the above screenshot)?
Edit: I found this(https://help.salesforce.com/articleView?id=domain_mgmt_url_delete.htm&type=5) documentation from salesforce. According to it, 'You can’t delete a URL that is attached to a published site. You’ll need to unpublish the site attached to the custom URL before you can delete it'. I tried that by deactivating the community but the custom URL delete option is still deactivated.