I dunno, I think it’s more complicated than that. First off, there are some things that should be prohibited - it’s illegal to privately own nuclear weapons, for the most extreme example. Second, many of these truly harmful drugs have tiny markets, and these markets are in fact propped up by other, more conventional drugs being illegal. If heroin were legal, very few if any people would even consider fentanyl, such that fentanyl could be prohibited entirely without having an out of control illegal market.
In some sense, though, we do already have a controlled legitimate market for these prohibited things. Even cannabis, even during the prohibition, had some legal purchase avenues for the purpose of research. Even nuclear, that’s manufactured by private businesses with permission from the government. That works for the vast majority of drugs, it only fails with popular, relatively low harm recreational drugs where the law just isn’t reasonable against the potential harm.