What is the ruling if one omits the required prostrations for every rak'ah and remembers this later?
Chapter on the Two Prostrations of Forgetfulness
Al-Mughni
Book of Prayer
Primary text
If one omits the two prostrations for every rak'ah and remembers this after completing the prayer, one must prostrate four times immediately, according to Al-Thawri and the People of Opinion. The view held by Al-Hasan ibn Salih, requiring eight prostrations, is considered invalid because the order (tartib) within the prayer is a condition and is not dropped by forgetfulness, similar to placing prostration before bowing while forgetting.
Supporting text
If one forgets the required prostrations, does not recall them until after the Taslim, and realizes the prayer is deficient by one rak'ah lacking a prostration, the prayer is invalidated, and one must restart the prayer according to a narration from Ahmad via Al-Athram.