You don't mean the idea of free will, you mean the value of autonomy.
Clearly the only reason to legislate anything is to limit the expression of free will. If we did not believe in free will, we would pursue something like https://www.thevenusproject.com/, stop trying to control behavior and just try to predict it and shape it via technology instead. So, their existence presumes free will, and does not contradict it.
Autonomy has been put forward as a basic principle of ethics by many, including Kant. But such ideas generally aim to universalize autonomy or spread it to as many individuals as possible. Very few cogently argue for simply increasing the autonomy of the majority even if this severely limits everyone else. Extreme libertarians do, but they can do so only by presuming that liberty and property are the only rights that really matter. (I would argue that by not at least covering the traditional range of Cardinal Virtues, i.e. not including safety and reciprocity as concerns, this is itself a position that reflects a certain level of privilege, and should be distrusted.)
Defending your choice to act upon chosen biases does not increase the general level of autonomy across the board, if at all.
First of all, the bias itself is not generally a choice, it is a traditional dictate, and so it does not really reflect autonomy. To be free to question it increases one's autonomy. Having counterexamples visible to you opens to you the opportunity to question the bias.
If those counterexamples do not arise from simply refusing to allow baseless application of the bias in place of logic and fairness, then the bias will be proven to have a point, we will figure out how to accommodate the facts of life, and the resistance will go away. (We don't, for instance, insist that one hire children on par with adults, or make onerous adaptations for someone like a blind graphic artist. We only truly challenge traditional biases that seem to have no realistic basis.)
Second, strong enough biases severely limit the autonomy of certain individuals while reversing them limits the autonomy of a wider range of people, but only mildly.
Let me offer an example now in our past: In highly religious areas of the U.S., it used to be traditional to shun the divorced. My grandmother, who had been a schoolteacher, therefore, lost her occupation, in addition to her husband, when he left her. She and her children suffered considerably until she could earn the money (as a house servant -- one of the few jobs she was any good at that did not force people to interact with her 'morally') to move to a more populous, less religious, region of the country, where she could return to teaching.
On the other hand, just insisting parents should trust her to continue doing the job she had always successfully held might have required they explain some difficult facts to their children, but would not have harmed anyone severely. Several decades later, teachers' unions negotiated laws that prevented immediately firing divorcees from educational settings.
When you balance it all out, it is highly ambiguous whether the overall level of autonomy has been raised or lowered by instituting such a rule. Teachers are now free to conduct their marital lives the same way everyone else can, but people can no longer protect their children from others who think it is OK to get divorced under some circumstances (like long-term abandonment.)
So, if you want to argue against anti-discrimination laws from the value of autonomy, it can be done only by taking the strange libertarian perspective of those whose main problem in life is being told what to do, over the perspective of people who are marginalized into poverty or death by the refusal to consider them potentially equal.
If you attempt to consider all perspectives equally and to consider more severe losses more highly than minor limitations, you ultimately find the patterns of discrimination around us are reducing the overall balance of autonomy, which makes them immoral according to the most commonly expressed ethical formulations, which are often a balance of Kantian fairness and Utilitarian perspectives.