Repentance does not prevent the enforcement of the prescribed punishment
When the prescribed punishments (hudud) reach the Islamic ruler and are established by suitable evidence, it becomes obligatory to enforce them, and by consensus they are not waived by repentance. The Ghamidi woman, after having repented, came to the Messenger of Allah ﷺ with a request that the prescribed punishment be carried out on her. The Messenger of Allah ﷺ said about her:
“She has made such a repentance that, if the people of Madinah were to make that repentance, it would be sufficient for them.”
Despite this, he carried out the prescribed punishment on her, and no one other than the ruler can do this. But as long as that punishment has not reached the ruler, a Muslim should remain concealed under Allah’s covering, and make sincere repentance; perhaps Allah will accept his repentance.