It's not perfect, but it's better than most of the alternatives, and perfect isn't actually on the table anyhow.
I get that HR might need to verify that this person is being fired for the right reason and that no discrimination is in play (which might happen unwittingly), but just keeping someone employed because they are a minority is not a good solution.
On a related note. If I was a minority, I would think that I was just being hired or kept on the team because I am a minority and not for my technical ability. This behaviour from HR would further encourage that thinking.
I think people doing this is the direct cause of some head-scratchingly awful middle managers I've had to deal with..
His pull requests sucked up hours of other devs time, but bad stuff still leaked through simply because the other devs didn't have time to rewrite his PR. He was fired eventually, but the ongoing cleanup still continues...