Answer crossposted from here: https://serverfault.com/a/852474/332852
I recently moved my Enterprise CA from a Server 2019 DC to a dedicated Server 2022 system. Unfortunately after the migration I had several issues because I followed a third party guide instead of the official Microsoft guide. The microsoft guide included a couple of important pieces of information about keep the name of the server the same (or making changes to reflect the change) and publishing CRLs to the old namespace.
The other thing that happened apparently is that the flags for our CA were not properly designating our CA as enterprise.
After you have verified that you actually have an Enterprise CA, let’s look at the CA object in ADSIEdit.msc and make sure the flag that identifies it as an Enterprise CA is set correctly. It is very unusual to see the flag set incorrectly, but all the same it is possible. As we did before, launch ADSIEdit.msc, then expand CN=Configuration | CN=Services | CN=Public Key Services | CN=Enrollment Services. Right click the CA in the right pane that you want to enroll from and click properties. Find the flags attribute; and verify that it is set to 10. If it isn’t set to 10, then set it to 10 using ADSIedit.msc and allow for Active Directory replication to complete.
Our flag was set to 2. I stopped the CertSvc, changed the flag to 10, restarted the CertSvc and presto chango, the templates were available again.