Failures are overwhelmingly in Phase II, https://en.wikipedia.org/wiki/Phases_of_clinical_research And we know why they happen, we don't need to guess. https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6609997/#:~:tex... Mostly it's that we discover previously unknown toxic effects. Between Phase I failures due to toxicity, Phase II failures which are half due to toxicity, and Phase III failures, and Phase III trails failing 17% of the time due to toxicity https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6092479/ it is overwhelmingly the biggest problem. Only half of Phase III trials fail due to a lack of efficacy.
At the same time effectiveness and safety are not independent variables. Safety often a matter of dose. The dose required to achieve a clinical effect may turn out to be unsafe.
The issues goes back largely to model validity. That our models don't allow us to accurately establish safety margins and dosages, in addition to often being misleading about the wider effects that drugs will have.