The assumption that an industry that has a large gender imbalance will inevitably end up discriminating against the minority gender is incorrect. Plenty of studies have shown tech companies to actually favor women in hiring:
Tech companies were more likely to give callbacks to female applicants: https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3672484
Modulating people to sound like the opposite gender in coding interviews actually hurts women and helps men: https://blog.interviewing.io/we-built-voice-modulation-to-ma...
There are policies that can eliminate bias: Strip names and identifying information out of resumes before recruiters see them. Modulate voices in interviews to eliminate ability to infer gender or foreign accents, and use no video so as to prevent people from identifying races. The problem is that this often doesn't produce the results people are expecting.
The comment you're answering to is talking about harassment and gatekeeping.
Hiring is one gate, but if you're hired just to reach gender goals or to satisfy the lust of your new manager, you will not have the same experience at the company than someone from the other gender. Like getting raises or being promoted.
Things are complicated.
Other factors like harassment are important, but again the evidence doesn't seem to suggest it's responsible for gender imbalances. Engineering has one of the lower rates of harassment among professional industries (32%) less than plenty of industries with more balanced gender representation like healthcare (35%) and media (41%) [1]. And this is just among white-collar industries, service industries and blue collar industries are by far even worse [2].
1. https://variety.com/2018/biz/news/media-industry-sexual-hara...
2. https://www.vox.com/identities/2017/11/21/16685942/sexual-ha...
Furthermore, I would argue that even in cases where discrimination is actually occurring, "stop acting in a sexually discriminating way because you're impeding someone's will" can be the only just solution to the problem. The alternative of actively and intentionally discriminating against other people in the majority group who did nothing wrong is unacceptable, both because it does nothing to address the root of the problem, and because discrimination on the basis of irrelevant factors like sex is wrong regardless of who the target of that discrimination is.
What's worse is when people use unequal outcomes as the sole justification for actively discriminating against majority groups, because now not only are you perpetrating these injustices in the pursuit of an ideal percentage of men and woman in the industry, but you're also running the risk of being wrong about what that ideal percentage is in the first place, actively pushing men and women into roles they wouldn't naturally choose in an ideal world where unjust discrimination didn't exist.
I understand the point you're making that ratio targeting seems immune to indications that a different natural ratio exists that differs from the imposed one, but I argue there is sensitivity to negative feedback. If there really is a natural sample ratio that differs materially from that found in the broader population, businesses will eventually be unable to hire according to the ratio. The danger is of course setting up a system that's wholly immune to that possibility and risk coming to lay upon a Procrustean bed. But I think profit motive is sufficient to dampen that risk. Businesses who are simply unable to find and hire qualified candidates who fulfill their target ratio will abandon that ratio by degrees.
It would be nice to deftly and precisely ameliorate this issue by just being able to say “stop acting in a sexually discriminating way because you're impeding someone's will,” and have it be so. But there are still far too many people who are willing to abet the discrimination either silently or willfully, writing the disparity off as a “natural outcome of biology.” So the alternative way to establish justice is the sledgehammer approach that equates the unequal representation with inequity. Because that is _also_ true.