Dalil

Quran As-Sajdah 32:18

أَفَمَن كَانَ مُؤۡمِنٗا كَمَن كَانَ فَاسِقٗاۚ لَّا يَسۡتَوُۥنَ

Translation

Then is one who was a believer like one who was defiantly disobedient? They are not equal.