I don't think I would say "everything happens for a reason" to someone who is suffering, but all the same for me and other people of faith it's a simple reality. But for people who disagree or struggle with the premise, it will offer no solace. They would probably feel like it dismisses and trivializes their suffering, and worse, they might attach other, unintended meanings.
History attests to the terrible condition of the world, and the Bible is very clear about that from the earliest parts of Genesis. There is so much pain, as a constant through the vastness of history and before. Saying everything happens for a reason doesn't necessarily deny that. When applied properly, it acknowledges the cruelty and struggle to find meaning, but that the reality is as it stands. Someone who does not believe may very well reject the notion of meaning, and see only the path of improving the situation as the answer. In the end, both types have among them people of goodwill, and we must be charitable to each other.
A sibling comment to yours mentions Candide, which takes "we live in the best of all possible worlds" very cynically. Voltaire disagreed with Leibniz's premises. But of course "best of all possible worlds" has lots of room for argument as to "best" means, and it certainly does not mean the best of all of _your_ possible worlds. As the joke goes, both the optimist and pessimist believe ours is the best possible.