A few reasons.Why China does not export generic drugs? I read online that most of Indian drugs are just Chinese API which is the main chemical ingredient of the Medicine. All India does is packaging and branding. What is the reason China never developed a generic drug export industry
One is political, it's better for China to export to the west via a third party than directly.
Pharmaceuticals that India exports don't tend to be high value anyway. It's not just the ingredients. Packaging, capsules, vials and even labelling is all imported from China. India is just the assembly line and gets a tiny cut.
Indians also have a number of advantages over other countries. They have massive economies of scale when it comes to purchasing power - most medications are consumed domestically), and medicine/pharmaceuticals is one field Indians are competent at.
It also gives China a lot of leverage over India. If they get too uppity they can say goodbye to their entire pharmaceutical industry overnight when tariffs are applied.
Doing something like this is something I seriously looked into a few years ago. Unless China blocks exports to India it's not worth it.