This is a false dichotomy. They could have done layoffs based on the company's needs and the performance of the employees. That isn't random.
Your big picture point amounts to a heckler's veto. The more you cater to the heckler, the more powerful the heckler becomes.
No, it kind of cemented that perception.
This means when you keep good engineers but lay off HR, marketing, sales, and admin employees, the layoffs look really bad in terms of affected protected groups.
For the company, this is a curse in good times, and a blessing in bad times.
It's not a chance, it's a guarantee. Every layoff gets lawsuits claiming discrimination and has so for decades. Which is why virtually every company does this analysis as a normal part of executing a layoff... and has done so for decades.
If they ignored race entirely, and just laid off people at random, there's a chance that someone later would say "Twilio employees are 35% female, 33% Asian, 9% Latino, and 6% Black, but the laid-off employees were 11% Latino! Racism!" and turn a mob against them. Once the media/Twitter/mob believe that Twilio HR and Twilio executives are racist, those execs might try to defend themselves by saying: "We weighted based on performance reviews, added a bit of statistical noise, and then did a random selection. We believe those performance reviews to be objective and free of racial bias. We didn't even realize that Latinos were slightly over-represented in the layoffs until you mentioned it, but it looks to be merely statistical chance. We actually fired slightly more white people and more men than the statistics would suggest, we're not bigots."
...Do you think that would work?
It's far easier to defend against the accusation of being overly woke than it is to defend against the accusation of being racist, so while you'd rather be neither, it's better to overtly and publicly fail in the safer direction.