Asalaam O Alaikum brother... see actually there is no direct reference to such Punishment in the Quran.... however a Verse mentioned in the Quran explains that Allah (swt) does not change the condition of such people who do not change themselves... and so unless He does not see the people of a nation having any good in them, he does not change their condition and give them good rulers... for example...
(Al Quran 13:11) "Verily, God does not change the state of a People until they change themselves."
The Prophet (saw) said that The Angels brings the deeds of men up to God, may He be Exalted, and that God asks them "In what state did you leave my servants ?" They Reply "We left them while they were praying, and we came to them while they were praying." (Mishkat, Bukhari, Nisai)
The words of Quran where Allah relates the change in people according to their actions has 2 meanings. One that Allah (Swt) does not change the condition of a nation and make them wretched until they themselves move away from the path of God and become misguided or choose misguided path over guided path.
2nd meaning is that Allah (swt) does NOT change the condition of a people who are sinners and bless them unless they themselves choose the guided path and become worthy of being blessed.
So in Words of Prophet Muhammad (Saw) when the Angels of the Day and Night who spent time on earth and bring back the deeds of a nation to Allah (swt), He decides based on their doings , whether good or bad that should they be blessed or they still need some more time or should be punished severely. In case of them being given a bad ruler, they are given by Allah (Swt) such sinner to rule over them, as a punishment so that they repent, mend their ways and Allah blesses them with good leaders.
Sorry if i didnt give you what you were looking for....