The Noble Scholar Shaykh Muhammad bin Sālih Al-‘Uthaymīn رحمه الله stated:

“Sometimes the act of disobedience has in it good for the one who is disobedient (to Allāh). That’s because, he becomes aware (of the harms of disobeying Allāh) when he sees its (evil) effects (in his life). As a result, he leaves off the act of disobedience and increases in doing righteous acts. Afterwards, he is better than what he was prior to (committing) the act of disobedience.”

[Sharh As-Saffāriniyyah Pg.330]

قال العلامة الشيخ محمد بن صالح العثيمين رحمه الله:

“المعصية يكون فيها أحيانًا خير للعاصي؛ وذلك أنه ينْتبه إذا رأى آثارها فيُقْلِع عن المعصية ويزداد عمَلًا صالحًا ويكون بعد المعصية خيرًا منه قَبْلَها”.“

[شرح السَّفّارينيّة لابن عثيمين ص٣٣٠]