#It's not a formal fallacy
It's not a formal fallacy
Formally, the argument is of the form:
We live in the best of all possible worlds
If we live in the best of all possible worlds, then if something happens then there is a good reason for it.
Something happened
Therefore there is a good reason for it
Or, symbolically:
A
A-->(B-->C)
B
∴ C
This argument is, in these terms, valid. If 'We live in the best of all possible worlds' (or similar) and the corollary premise regarding good reasons are not premises, then the argument is a nonsequitur, which is to say it commits the very general catch-all formal fallacy of possessing a conclusion that does not follow from its premises.
#Informal Fallacies are not matters of logical certainty
Informal Fallacies are not matters of logical certainty
Informal fallacies aren't absolute logical truths but rather ideas about what sorts of arguments are bad. Usually, informal fallacies have an implied premise which those believing the reasoning to be fallacious categorically reject. For example, an ad hominem argument might carry the implicit premise 'people with stupid faces can't be right'. If we accept that premise, the argument "You are not right because you are a person and your face is stupid" is a totally valid argument from a formal logic standpoint. Nevertheless, because it is sufficiently universally agreed that 'people with stupid faces can't be right' is false we can categorically dismiss all arguments that rely on that premise.
The problem with your category of fallacious argument is that a lot of people, including many notable and influential philosophers and scholars throughout the ages, genuinely affirm the position that everything happens for a reason. For example, the vast majority of Christian, Jewish, and Islamic thought-- St. Augustine, Al-Ghazali, Avicenna, St. Thomas Aquinas, Philo of Alexandria, to name a few-- for the last thousand years strongly affirms the idea that the universe is fundamentally ordered by God and consequently everything which exists must have some good reason that it has been permitted to exist. Consequently, there isn't a universally recognized fallacy here, since the falsity is very much still under dispute. There are a lot of people who believe this position is false, as well, and that has given rise to terms like e.g. Just-World fallacy, but these terms are not very well established and do not enjoy broad recognition the way e.g. ad hominem or petitio principii do.