Allah describes one of the responses of Fir’awn and his people to Moosaa in surah Ghaafir where He says:
فَلَمَّا جَاءَهُم بِالْحَقِّ مِنْ عِندِنَا قَالُوا اقْتُلُوا أَبْنَاءَ الَّذِينَ آمَنُوا مَعَهُ وَاسْتَحْيُوا نِسَاءَهُمْ ۚ وَمَا كَيْدُ الْكَافِرِينَ إِلَّا فِي ضَلَالٍ
And when he brought them the truth from Us, they said, “Kill the sons of those who have believed with him and keep their women alive.” But the plan of the disbelievers is not but in error. [40:25]
In part of his commentary on this ayah, Imam ‘Abd al-Rahman al-Sa’di made the following remarks:
فما كيدهم إلا في ضلال، حيث لم يتم لهم ما قصدوا، بل أصابهم ضد ما قصدوا، أهلكهم الله وأبادهم عن آخرهم. ـ
So their plan was not but in error, such that they were not able to complete what they had intended. Rather, they were afflicted with the opposite of what they intended: Allah destroyed them and obliterated them even unto their last ones.
وتدبر هذه النكتة التي يكثر مرورها بكتاب الله تعالى: إذا كان السياق في قصة معينة أو على شيء معين، وأراد الله أن يحكم على ذلك المعين بحكم، لا يختص به ذكر الحكم . وعلقه على الوصف العام ليكون أعم، وتندرج فيه الصورة التي سيق الكلام لأجلها، وليندفع الإيهام باختصاص الحكم بذلك المعين. ـ
Reflect upon this subtle and wise wording which occurs frequently in the Book of Allah: when the context is dealing with a specific story or regarding a specific thing and Allah wishes to make a ruling on that specific thing, He does not make the mention of the ruling exclusive to only that thing. (Rather) He connects the ruling to the general characteristic in order that it would be more general. So this story which is the focus on the context is included therein (in the ruling), and this is also done in order to repel any false ideas of the ruling being limited only to that specific thing.
فلهذا لم يقل { وما كيدهم إلا في ضلال } بل قال: { وَمَا كَيْدُ الْكَافِرِينَ إِلَّا فِي ضَلَالٍ } ـ
So because of this He did not say, ‘and their plan is not but in error‘. Rather He said:
وَمَا كَيْدُ الْكَافِرِينَ إِلَّا فِي ضَلَالٍ
But the plan of the disbelievers is not but in error
[Taysir al-Kareem al-Rahman pg. 866]
See also: The Proper Place of Asbaab al-Nuzool in Understanding the Qur’an: Imam al-Sa’di
See also: Technical wordings for Asbaab al-Nuzool: Ibn ‘Uthaymeen
See also: A Principle to Dispel Specious Arguments and Doubts: Tafsir al-Sa’di
See also: Four Means of Attaining Allah’s Forgiveness: Imam al-Sa’di
See also: A Benefit of General Language in Surah al-Duhaa: Sheikh ibn ‘Uthaymeen