BIP32 allows both ' and h as hardened derivation marker. Our legacy wallet uses '. Since #26076 our descriptor wallets use h by default.
ParseHDKeypath only supports '. It's currently only used in the legacy wallet context, so this doesn't cause any problems. But it will once #22341 uses it (to parse the RPC path argument for getxpub). Might as well fix it now.
I added a restriction for not combining h and '. Afaik this currently isn't enforced anywhere else in the codebase, including for descriptors, but it seems sane. I've occasionally messed that up in the past.