In the USA specifically, selling a non-scheduled analog of an illegal drug for human use as a psychoactive drug is absolutely illegal. In the USA, a company can legally sell non-scheduled analogs of illegal drugs if they are not sold for human consumption, and have no mention of their psychoactive effects.
Here’s how the law there reads, “a controlled substance analog(ue) shall, to the extent intended for human consumption, be treated, for the purposes of any Federal law as a controlled substance in Schedule I.”
For example, you could sell 5-MeO-AMT as a drug used in animals testing. But if it’s stated that it’s sold for human ingestion, then it’s completely illegal.
That’s how I read that law, but I’m no lawyer.