i.e trying to diversify to discourage racism so you end up prefering minorities who are less fit for a job than just to be "diversified"
If the goal is to raise opportunity for a historically disenfranchised group, this may not meet the end goal. For example, imagine a hiring goal is to increase the number of minority X. This may give additional leverage to someone of that group who already comes from a well-connected family and already has the opportunity to obtain the necessary credentials. It does nothing to give the opportunity to those in a less privileged group obtain those credentials in the first place. It doesn't mean it's wholly bad policy, but it can lead to the pattern of pointing to those successful outcomes as evidence that we're in a post-racial era. And so even less focus is paid to those who actually need more opportunity.
If we put the idea of Cobra effect aside, these companies are also trying to bargain because vulnerables and minorities would prefer to work for them than for other companies that don't express their preference of minorities, so eventually many of them will accept less pay to feel more welcomed, which is - in my opinion - pure emotional exploitation, they claim they have ethical reasons but actual many of them has only unethical reasons