All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
If the praying person forgets to recite a verse in a chapter other than the opening chapter (Al-Faatihah), he does not have to make the prostration of forgetfulness. The Prophet, sallallaahu ‘alayhi wa sallam , once forgot to recite a verse in prayer and did not prostrate as reported by Ahmad and An-Nasaa'ee. When the Prophet finished the prayer he asked: “Is Ubayy Ibn Ka'b among you?" So Ubayy asked, "Has the verse (that you failed to read) been abrogated or did you forget it?" The Prophet, sallallaahu ‘alayhi wa sallam, replied that he had forgotten it, and it was not reported that he prostrated after realizing that he had forgotten to recite the verse.”
Also, some jurists stated that whoever forgets a verse from the opening chapter (Al-Faatihah) and did not correct himself before he bows, has to prostate for forgetfulness before saying 'Salaam' (concluding the prayer). However, to be on the safe side it is more appropriate that he repeats the prayer and if he does not prostrate for forgetfulness, then his prayer is invalid. Also, if he remembers that he has forgotten a verse (from Al-Faatihah) before he bows and did not rectify himself by reciting it, then his prayer is also invalid.
Other opinions have been reported in this regard but what we consider what we have stated to be more correct, if Allaah wills.
Allaah Knows best.