You people recite this verse "You who believe, care for yourselves; he who goes astray cannot harm you when you are rightly-guided," and put it in its improper place. Khalid's version has: We heard the Prophet ﷺ say: When the people see a wrongdoer and do not prevent him, Allah will soon punish them all. Amr ibn Hushaym's version has: I heard the Messenger of Allah ﷺ say: If acts of disobedience are done among any people and do not change them though the are able to do so, Allah will soon punish them all. Adu Dawud said: This tradition has also been transmitted by Abu Usamah and a group transmitters similar to the version narrated by Khalid. The version of Shu'bah has: "If acts of obedience are done among any people who are more numerous than those who do them...."
أَنْ حَمِدَ اللَّهَ وَأَثْنَى عَلَيْهِ يَا أَيُّهَا النَّاسُ إِنَّكُمْ تَقْرَءُونَ هَذِهِ الآيَةَ وَتَضَعُونَهَا عَلَى غَيْرِ مَوَاضِعِهَا { عَلَيْكُمْ أَنْفُسَكُمْ لاَ يَضُرُّكُمْ مَنْ ضَلَّ إِذَا اهْتَدَيْتُمْ } قَالَ عَنْ خَالِدٍ وَإِنَّا سَمِعْنَا النَّبِيَّ ﷺ يَقُولُ إِنَّ النَّاسَ إِذَا رَأَوُا الظَّالِمَ فَلَمْ يَأْخُذُوا عَلَى يَدَيْهِ أَوْشَكَ أَنْ يَعُمَّهُمُ اللَّهُ بِعِقَابٍ وَقَالَ عَمْرٌو عَنْ هُشَيْمٍ وَإِنِّي سَمِعْتُ رَسُولَ اللَّهِ ﷺ يَقُولُ مَا مِنْ قَوْمٍ يُعْمَلُ فِيهِمْ بِالْمَعَاصِي ثُمَّ يَقْدِرُونَ عَلَى أَنْ يُغَيِّرُوا ثُمَّ لاَ يُغَيِّرُوا إِلاَّ يُوشِكُ أَنْ يَعُمَّهُمُ اللَّهُ مِنْهُ بِعِقَابٍ