What is required if one omits the prostrations for a rak'ah but only remembers after completing the subsequent rak'ah?
Chapter on the Two Prostrations of Forgetfulness
Al-Mughni
Book of Prayer
Primary text
If one omits the two prostrations of a rak'ah and remembers this after commencing the recitation of the next rak'ah, the previous rak'ah is invalidated. Consequently, one must make up the missed rak'ah and then perform the prostration of forgetfulness. This view is held by Malik and Al-Layth because starting the next rak'ah invalidates the completion of the previous one. If this occurs across multiple rak'ahs, only the final, complete rak'ah remains valid.
Supporting text
Another narration from Ahmad suggests the entire prayer is invalidated because the repeated omission leads to the appearance of playing with the prayer, requiring the nullification of many prior acts. Ishaq and Abu Bakr al-Ajurri agree with this view. Shafi'i held that two rak'ahs would be valid based on the nullity of the action in the next rak'ah.