The existence of a black market doesn't negate the impact of legalization.
In North Korea and China there is a massive black market of movies because there is no alternative distribution network.
In the USA there is a smaller black market because piracy offers benefits over streaming services.
If the government decided entertainment was a human right and gave everyone free streaming subscriptions, the black market would shrink further because the utility that piracy provides would decrease.
Now if your goal is to prevent fentanyl from being cut with other things then you would want to shrink the black market. I personally think that a state monopoly on drugs would be your best bet. To eliminate a black market totally you would just give infinite fentanyl away for free.
But if your goal is to reduce overdoses then you would need to balance availability with safety, which is a tricky utility function. Adding requirements like rehab, or rationing fentanyl, or only letting people get high in a location with medics on standby only increases the utility of going to the black market since you can get high without jumping through hoops for Big Brother.
However I don't think anyone in our government or media seriously takes any of this into consideration. It seems like a 50/50 mix of moral judgements on addicts and using drugs as a talking point to manufacture border crisis narratives. Any mainstream discussion of the topic is usually just to scare people so they will be more susceptible to whatever inhumane "solution" is proffered by a talking head immediately afterwards.
Which is exactly the response you see in the OP I was replying to. "Well this policy decision isn't perfect, but the alternative is far worse" is basically the opinion that the media wants us to have when they run stories like this.