…وَالْمُؤْتَفِكَاتِ… (and the towns overturned): It refers to the people of Lot, as Allah (swt) turned the highest part of the city into its lowest.
Here, Allah (swt) mentioned specific individuals and communities, specifically the people of Noah, ‘Ad, Thamud, the people of Abraham, the companions of Midian, the people of Shu’ayb, and the overturned township (referring to the people of Lot).
…أَتَتْهُمْ رُسُلُهُم بِالْبَيِّنَاتِ ۖ فَمَا كَانَ اللَّهُ لِيَظْلِمَهُمْ وَلَٰكِن كَانُوا أَنفُسَهُمْ يَظْلِمُونَ (Their messengers came to them with clear proofs. And Allah would never have wronged them, but they were wronging themselves.): The Messengers came to them and clarified them the truths. Indeed, Allah (swt) did not wrong them, but they wronged themselves.