I'd work through this one to clean it up.
https://learn.microsoft.com/en-us/troubleshoot/windows-server/identity/remove-orphaned-domains
--please don't forget to Accept as answer if the reply is helpful--
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I have a domain that I can't remove. It's not a child-domain of our primary domain, it's separate... possibly a trusted domain which no longer exists. Under AD domains and trusts, it is listed as:
domainB is no longer needed, and its domain controllers are no longer on the network.
I can't find a way to remove it from our system. It doesn't show under incoming or outgoing trusts.
The DCs in domainA log events about not being able to find writeable sources for this domain/partition.
I'd work through this one to clean it up.
https://learn.microsoft.com/en-us/troubleshoot/windows-server/identity/remove-orphaned-domains
--please don't forget to Accept as answer if the reply is helpful--
Maybe this one.
https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-2000-server/bb727062(v=technet.10)#remove-a-manually-created-trust
also look for references here.
https://learn.microsoft.com/en-us/windows-server/identity/ad-ds/deploy/ad-ds-metadata-cleanup
https://techcommunity.microsoft.com/t5/itops-talk-blog/step-by-step-manually-removing-a-domain-controller-server/ba-p/280564
--please don't forget to Accept as answer if the reply is helpful--
Maybe this one helps.
https://johnhowto.wordpress.com/2015/02/16/ms-metadata-cleanup-error-the-directory-service-can-perform-the-requested-operation-only-on-a-leaf-object/
--please don't forget to Accept as answer if the reply is helpful--
Where specifically do you see the problem? What operating systems are involved?
We've covered all the bases here so something else may be broken. This tool may give you clues where the orphaned object is.
https://learn.microsoft.com/en-us/sysinternals/downloads/adexplorer
then may need adsiedit to do more cleanup.
I'd suggest starting a case here with product support.
https://support.serviceshub.microsoft.com/supportforbusiness
--please don't forget to Accept as answer if the reply is helpful--