This has always felt like an excuse used by people who who just don't want to be caught in their own lies when asked to come up with a real, non-discriminatory reason.
As one pointed out, there's a "well you said it was X, but person Y who got hired did that too. And they're a different race or gender or religion, so that leads me to believe discrimination."
There's also you trying to be helpful, saying something along the line of "well you hesitated a bit and sounded unsure in your answers", only to find out they have some disability that caused that and now have admitted you're discriminating based on it.
Maybe you'll say "well, if I had known, I wouldn't have noticed it or cared." And a lot of candidates would likely say as much up front. But they don't have to tell you about it at all. See how that creates a weird dynamic?
Is it common? Probably not. But it obviously happened or else such rules wouldn't exist. It's one of those things that the bad actors ruin it for everybody. Bigots are never going to admit their reasons - good people will. But bad people will always try to take advantage, regardless.
Say you say it was for failure to meet a specific performance standard (because that is the documented reason); then the ex-employee has a starting point for an discrimination claim by looking for evidence that trnds to support the claim that people who differ on some protected-from-discrimination axis who failed to meet that standard were not fired. No reason given, no starting point. In theory, this policy helps make false nuisance claims more work and less likely, but a substantive reason for it is that HR knows that they cannot eliminate all prohibited acts by managers that would create liability, so making it harder to get a starting point for gathering evidence is important to prevent valid claims from materializing. HR policy does not exist to protect employees from unlawful treatment, it exists to protect the company from liability for such treatment. Sometimes thise two interests align, but when it comes to information about firing decisions they do not.
There’s similar things that can be done with other prohibited reasons for dismissal, loke retaliation; but the idea is any information you give makes it easier for them to make a case against you.
This is also, in reverse, why, as a departing employee (whether departing voluntarily or not), you should never participate in an exit interview or, if you must as a condition of some severance or other pay or benefit, never volunteer any information beyond the bare minimum necessary; one significant purpose of such interviews is to document information useful either for potential claims against you or to defend against any potential claims you might have, including those you have not yet discovered, against the company.
I bet you this comes back to insurance, as many things do in the corporate world. Sufficiently large companies probably have insurance coverage for discrimination lawsuits, or at least employment disputes in general. The coverage probably costs less if you have a "no feedback" policy.