An incorrect optimization caused "CNAME and other data" errors not to be detected if certain types were at the same node as a CNAME. This has been fixed.
Closes #5150
Merge branch '5150-cname-and-other-data-check-not-applied-to-all-types' into 'main'