The two prerequisites to introducing the first 2019 or 2022 domain controller are that domain functional level needs to be 2008 or higher and older sysvol FRS replication needs to have been migrated to DFSR
Also may need to perform some cleanup to remove remnants of any that no longer exist.
Clean up Active Directory Domain Controller server metadata
Step-By-Step: Manually Removing A Domain Controller Server
--please don't forget to upvote
and Accept as answer
if the reply is helpful--