So don't let people sell the drugs at a profit, at early stages.
A downside would be that for drugs that don't cost much to produce, patients might be less willing to enroll in the studies, given the chance of getting a placebo. That could be handled by shutting down the informal access while the study is enrolled, for anyone who's eligible. I'm sure there are other wrinkles that would need to be considered too.
Unless it does have to be somewhat viable, which is… regulation.
Restricting this to patients who are otherwise out of options is probably also a good idea. Pancreatic cancer would certainly qualify.