Eligible candidates for most jobs are not 50:50 in gender. For some fields it may be 90:10. This means a perfectly fair selection process will select 90 men and 10 women for every 100 jobs, or at least in this ballpark.
Affirmative action is mostly policed by media pressure. The media does not give a shit about the above math. They will read the line in the annual report that says '90% of our engineers are male' and name and shame you on twitter. Alternatively, being more politically correct than your peer competitors is a way to virtue-signal and you get little award badges to put on your website.
The politically correct ratio is 50:50. Let's say you have 100 available jobs and 1000 candidates, 900 men and 100 women. To enforce 50:50, you choose the best 50 men out of 900 and best 50 women out of 100.
Your hypothesis is that affirmative action unlocks economic benefits. This is asserting that the marginal female engineer who is better than 50% of her peers is superior to the marginal male engineer, who is better than 94% of his peers. Additionally, the difference must be large enough to overcome the inefficiency of messing with market mechanisms.
This is an extraordinary claim and would require extraordinary evidence.
What about the effect of nepotism? Let's say the hiring manager really doesn't like women, and the selection ends up 95:5. Five marginal female engineers are replaced by five marginal male engineers. Compared to the huge skewing above, this is a blip on the radar. Note I am not saying it is not a problem, I am saying the current solution is on average much worse.
I do not doubt that for some pathological cases affirmative action actually does have a positive effect on the bottom line. But this will only happen when the company is badly screwing up recruitment. On the other hand, companies with saner, optimized hiring processes are penalized with an arbitrary ratio.
The effect here is to boost inefficient businesses and penalize relatively efficient ones.