When the warning appears, it usually gives you an option or a workaround to follow. Can you give a screenshot of the error?
Moreover, projects can be restored within 30 days before they are permanently deleted. A workaround is to restore the project, remove the custom domain on the restored project (as simple as clicking the trash button), and delete the project again.