I personally believe Quran said in three places, not to attribute purity in ourselves:
1. Surah Nisa - context, religious leaders of Christians and Jews were opposing Mohammad (s) and his family (a) Authority based on "their Authority" from God and the Prophets (a), who truly is supposed to inherit this authority and claim purity, those chosen by God (like Mohammad (s)) or leaders chosen by people and attributed "righteousness" by people? This is the context of this one.
2. Surah Noor - context, some people now into Islam saw themselves sexual more pure then others and began to bad mouth and spread rumors about believers doing sexual deviated acts with no proof, God said, where it not for his compassion, no one would have been attributed purity (that he manifested Mohammad (s) as pure out of compassion to guide us, not so we get full of ourselves after he purifies a bit), and that this should not lead us to think we can attribute purity to ourselves and talk as if we are sexual less prone to deviance then others (gossip pride results from this).
3. Surah Najm - Soothsayers claimed they represented gods/angels/jinn and had some sort of higher connection, God says he knows best who has taqwa, and they have no proof they are more righteous or pure then others in guiding them.
Over all the message to me, is purity and righteous is to be claimed by those appointed by God and we can know people once they die, what state sometimes they are in or from hadiths, but it's really for God to appoint us leaders/guides and teachers he attributes as higher status and pure.
This is my view. And this why I'm alone right now in my path.