It's not easy to put that Nitrogens in the middle of the chain. Moreover, the method to produce it is to mix some smaller chains that have the Nitrogen in the ends of the chain and make them combine in a longer chain.
This produces a mix of a lot of similar chains with different length and number of Nitrogen. They have similar properties, so it is difficult to separate them. They use distillation. But at high temperature that Nitrogens like to burn, so heat the mix carefully.
Also, the mix you produce have a lot of compounds with the same "2D" formula, but they have a different shape in "3D". Some of the versions may have totally different properties, like been very toxic. So you must separate them too, and again, it's difficult.
Note: I studied a Chemistry specialization in the Secondary School, so I have some general knowledge about this, but I'm far from an expert in medical drug production.
Note 2: If you like this kind of things, I recommend to see the Nile Red channel in YouTube https://www.youtube.com/channel/UCFhXFikryT4aFcLkLw2LBLA It's nice to see some easy and not so easy projects, and he explain the reactions, and the problems and pitfalls he found. (I don't understand everything he does.)
---
Anyway, the difference of the cost of the medical drug and the chemistry drug is annoying.
https://www.sigmaaldrich.com/catalog/product/aldrich/132098?...
How do you get from 60% to 99%? Do you have to (for pharmaceutical grade)?
What are the remaining 40%? poison? harmless byproducts?
Of course the latter two eventually will get you in deep shit with the FDA.
Ah, so we should just get rid of those regulations and let the little guy compete!
Not so fast. Maybe the first new market entrants are motivated by altruism as much as by profit. They do everything carefully but charge prices closer to cost. Patients pay less and there are hardly any downsides, except to the financials of legacy pharma companies.
But by year 3 there are people who have learned that you can buy barrels of technical-grade active pharmaceutical ingredients off of Alibaba and make pills from them without any quality control in between. Sometimes the products are contaminated with carcinogens. Sometimes they vary widely in potency across lot numbers. In the absence of regulations, fraudulent and shoddy products become widespread. It would be like the supplements industry, except that people actually die if they don't take real prescription drugs they need (this is less common for people who are sold fake herbs.)
You likely need to prove that you are producing a clean product, etc.
Similar to how there is regulation of you make food at industrial scale.