All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad,
, is His slave and Messenger.
Your prayer is valid in any case and you did not have to prostrate to forgetfulness. Rather, the treatment of whispers is to avoid them, repel them, and not pay any attention to them.
You do not have to prostrate for forgetfulness due to them.
For more benefit on whispers and how to repel them, please refer to Fatwa 174507.
Allah Knows best.