This doesn't follow at all though. Racism and discrimination require intent. If race and sex have noting to do with the firing decision then it's not racist or sexist. It doesn't matter what the outcomes are. You can obviously make the case that if the stats are too biased to one side that there is racism/sexism involved in the decision, but that's a different matter.
If you shut down a factory in China because it doesn't make economic sense anymore then that's not racist, despite everyone that's going to be laid off being Chinese.