You're right that if your search is incomplete the sort of thing you describe can happen. In my industry (academia) search is complete. Everyone looking for a job knows all the job postings.
That said, I think the problem is that overall there aren't enough qualified under-represented minorities to get up to proportional representation. If there were, it would be a very confusing market failure. What's really going on is two things:
1) You can't be both under-privileged and as capable as everyone else on average. Being poor, abused, discriminated against, etc. affects our ability to do things like be really smart and get good at software engineering.
2) For those who are under-represented but not on average under-privileged (e.g. women in mathematics), we are seeing the result of a difference in preferences between men and women. Blue Team elites really don't want to admit that there are systematic differences in who prefers what that correlate with things like gender and race, but it is obviously the case. It's not rampant sexism relative to biology that explains why there are few women in e.g. mathematics, it's because women prefer to do other things on average. And there's nothing wrong with that, and we as a liberal society need to accept it.
Of course, this is absolutely not to claim that women can't be just as good at maths.