Recall that Moses said to his people, “O my people, why do you hurt me, even though you know that I am God’s messenger to you?” When they deviated, God diverted their hearts. For God does not guide the wicked people.
وَإِذ قالَ موسىٰ لِقَومِهِ يٰقَومِ لِمَ تُؤذونَنى وَقَد تَعلَمونَ أَنّى رَسولُ اللَّهِ إِلَيكُم فَلَمّا زاغوا أَزاغَ اللَّهُ قُلوبَهُم وَاللَّهُ لا يَهدِى القَومَ الفٰسِقينَ
wa iz qaala Moosa liqawmihee yaa qawmi lima tu’zoonanee wa qat ta’lamoona annee Rasoolul laahi ilaikum falammaa zaaghooo azaaghal laahu quloobahum; wallaahu laa yahdil qawmal faasiqeen