Hi,
After you demote a domain controller, it still shows in the ADUC or the AD site and service ,then we should perform a metadata cleanup.
Clean up server metadata using Active Directory Users and Computers
Clean up server metadata using Active Directory Sites and Services
Clean up server metadata by using Ntdsutil
For more information ,you can refer to:
https://learn.microsoft.com/en-us/windows-server/identity/ad-ds/deploy/ad-ds-metadata-cleanup
After you do the metadata clean, it should work as a normal domain member .You can disjoin the server from the domain and rejoin it again.
Best Regards,