40-21
Did they not travel in the earth and see how the end of those before them was (brought about)? They were severer than them in strength and (in constructing) memorials in the earth, but Allah caught them for their sins, and there was no one to guard them from Allah.
Earlier generations too were destroyed because they rejected their
40-22
That was because, their messengers had come to them with clear proofs but they rejected (them) so Allah caught them, He is certainly Strong, Severe in requital.
Qaroon was from Bani Israel but he did not believe in Musa (PBH) whereas there was a person from Firawn’s people who believed in Musa (PBH) and even argued with Firawn and his people in favour of Musa (PBH). This again shows that one’s being a Momin and a Muslim does not depend on one’s relationship with good or bad people see also Chapter:19 Verses 51-55 commentary.