In one narration the words are: "Whoever commits a sin and the hadd punishment for that sin is carried out on him, that punishment becomes his expiation."
Al-Tabarani recorded it, and Ahmad recorded something similar. Its chain contains a narrator who is not named, and he is the son of Khuzaymah. The rest of its narrators are thiqat (trustworthy).
Hadith Referenceمجمع الزوائد ومنبع الفوائد / كتاب الحدود والديات / 10596
Hadith Gradingمحدثین:إسنادہ ضعیف
Hadith Takhrij«اخرجه الطبراني فى المعجم الكبير “ (3732)»