Imam Baqir (a.s) said: “You will not experience any calamities except due to committing sins. However God is even more forgiving than that.”
عنه (عليه السلام) قال
ما يصيب العبد إلا بذنب وما يغفر الله منه أكثر.
Similar narrations
Al-Kāfi #963“No failure ever takes place in the life of a servant (of Allah) except because of sin and that which Allah forgives him for is much more.”