The tl;dr is that chemistry is incredibly complex and then biology is even more complex and messy. Even if we think we understand the mechanism by which a medicine may work, we definitely do not know how something will certainly behave in the wider system OR whether something works the way we truly think it does (by the time a medicine arrives in the place it needs to be is it actually some chemical artifact after being "touched" so many times along the way).
We have a complex system, and we don't have the author or source code to hand, and we're still quite limited in how we can observe any changes. Any time we do try to introduce something we basically have to pray that there are no side effects