Evil thoughts whilst performing sajdah
In the name of Allah, the most Beneficent, the most Merciful.
Answer
Allah (SWA) in the Holy Qur’an has said:
“Allah does not obligate anyone beyond his capacity.” (Surah Baqarah v.286)
There are two aspects to human deeds. One is an outward deed and the other is an inward deed. Each of these two aspects is further divided into two kinds. Voluntary and Involuntary. Examples of outwards deeds done voluntarily is to speak by choice or to beat somebody by choice where as saying something other than what one actually intended to say, or a palsied hand moving unintentionally caused pain to somebody.
Similarly, inward deeds which are voluntary is belief in kufr and shirk and non-voluntary, for instance the entry of some evil thought in one’s heart without an intention.
Voluntary deeds will be rewarded or punished. Similarly inwardly voluntary thought will be rewarded or punished. However, involuntary actions will not be subject to any punishment. (Maariful Quran p.722 v.1)
From your question it sees as though that the thought, which crossed your mind whilst performing the sajdah, was an involuntary action and something you did not mean. Therefore, your Iman will still be intact.
Only Allah Knows Best
Mohammed Tosir Miah
Darul Ifta Birmingham