I'd check the health of other domain controllers and role holders as first step.
netdom query fsmo
also dcdiag, repadmin tools may be helpful. If all checks out then the other option is to remove from network then seize roles (if necessary)
https://learn.microsoft.com/en-us/troubleshoot/windows-server/identity/transfer-or-seize-fsmo-roles-in-ad-ds
then do metadata clean up.
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
If you needed further assistance then please run;
Dcdiag /v /c /d /e /s:%computername% >c:\dcdiag.log
repadmin /showrepl >C:\repl.txt
ipconfig /all > C:\dc1.txt
ipconfig /all > C:\dc2.txt
then put unzipped
text files up on OneDrive and share a link.
--please don't forget to Accept as answer if the reply is helpful--