And mention when Moses said to his people ‘O my people why do you harm me — for they had said that he had a hernia in his testicles which he did not have and they denied him — when certainly qad is for confirmation you know that I am the messenger of God to you?’ annī rasūlu’Llāhi ilaykum this sentence is a circumstantial qualifier and when you know that messengers ought to be respected. So when they deviated when they swerved away from the truth by harming him God caused their hearts to deviate He turned them away from guidance in accordance to what He had preordained since pre-eternity and God does not guide the immoral folk those who in His knowledge are disbelievers.
- 61:55
وَإِذْ قَالَ مُوسَىٰ لِقَوْمِهِ يَا قَوْمِ لِمَ تُؤْذُونَنِي وَقَدْ تَعْلَمُونَ أَنِّي رَسُولُ اللَّهِ إِلَيْكُمْ ۖ فَلَمَّا زَاغُوا أَزَاغَ اللَّهُ قُلُوبَهُمْ ۚ وَاللَّهُ لَا يَهْدِي الْقَوْمَ الْفَاسِقِينَ
When Moses said to his people: "O my people, why do you afflict me though you know that I have been sent to you by God?" But when they turned aside God made their hearts turn farther away; for God does not show the transgressors the way.
- common.revelation-Medinan
- common.hizb : 220