Allah will not punish those who make istighfaar
وَمَا كَانَ اللَّهُ مُعَذِّبَهُمْ وَهُمْ يَسْتَغْفِرُونَ
“…And Allah will not punish them while they seek forgiveness.” (8:33)
Ibn Taymiyyah, may Allah have mercy on him, commented on this ayah saying:
أخبر الله سبحانه أنه لا يعذب مستغفراً، لأن الاستغفار يمحو الذنب الذي هو سبب العذاب، فيندفع العذاب
“Allah the Most Exalted informed (us) that He does not punish the one who makes istighfar [to seek forgiveness from Allah]. This is because istighfar erases the sin, which is the reason for punishment. So the punishment is thus repelled.”
(Majmu’ Al-Fatawa)