modern pharma R&D is pretty much move fast and break things. All modern pharma firms spend enourmous effort to ensuring that errors are cought as early as possible (shift left) in R&D.
Hundreds of molecule candidates are discarded before reaching Phase 3 trials
Most of the cost in pharma trials is not due to safety testing, it is in testing whether it is effective and whether it is better than the competition.
I'm not really involved in pharma, but there seems to be a decent argument for selling the drug with provisional approval after safety has been established and collecting outcomes data for those who use provisional drugs https://reason.com/2018/02/02/right-to-try-fda-drug-trials/