I saw it at the enterprise level during the last layoff hell when thousands were let go at my company. On the ground, there was almost little to no logic to the layoffs because the decisions were made by disconnected execs who sit in bullshit meetings all day.
In fact, it goes both ways. Even when teams are expanded out - a decision made in partnership some absurd headcount planning 3rd party consultants - it's almost as if they never talked to the team, but some exec who is 3-4 layers removed from the actual valuable individual contributors who understand the work, have frustrations and desires and should theoretically have a part in influencing planning decisions.
HR is the department responsible for knowing this and not allowing this sort of bs.
How HR decided to use the reason "low performance" doesn't look great at all, but from my collaboration with HR compliance folks in the past I don't think it's a violation because it's technically the "truth".
And now they have created a bit of a pr snafu. How many talented people with good performance reviews at Cloudflare are now looking for the door.