He lost his wudoo’ whilst doing the prostration of forgetfulness (sujood al-sahw); what should he do?
What is prescribed in the prostration of forgetfulness is to say in it and between the two prostrations what one says in prostration during prayer, so you should say tasbeeh whilst prostrating and say Rabb ighfir li (Lord forgive me) between the two prostrations. But if you forget any of that, you do not have to do another prostration for forgetfulness, so that it does not become an endless cycle.
It says in al-Sharh al-Kabeer (1/700) about matters for which no prostration is required: It is not prescribed to do the prostration of forgetfulness in the funeral prayer, because there is no prostration in this prayer, so how could you do a prostration to make up for a mistake in this case; or in the prostration of recitation, or in the prostration of forgetfulness. This was stated by Ahmad. And because there is consensus narrated by Ishaaq, because it would become an endless cycle. So if he forgets something after doing the prostration of forgetfulness, he should not prostrate again for that reason. And Allah knows best. End quote.
It says something similar in Mataalib Ooli al-Nuha (1/507).
To sum up: if a person forgets something during the prostration of forgetfulness, he does not have to do anything else, and his prayer is valid.
If a person loses his wudoo’ during the prostration of forgetfulness, the matter is subject to further discussion:
1. If he prostrated before the salaam, his prayer is rendered invalid, because saying the tasleem at the end of the prayer is a pillar or essential part of prayer, and he broke his wudoo’ before doing this essential part.
2. If he had said the salaam at the end of his prayer, and he only had the prostration of forgetfulness to do, then he lost his wudoo during it or before he did it, then his prayer is valid and he does not have to do anything else, because the prostration is making up for a mistake in the prayer, and it is not rendered invalid by missing it.
It says in Kashshaaf al-Qinaa‘ (1/409): If a person forgets the prostration of forgetfulness until he starts another prayer, then he remembers it, he should make it up when he says the salaam, if a long time has not passed. But if a long time has passed, he should not do this prostration, because it is done to complete a prayer, so it should not be done after a long time has passed. Or if he has left the masjid he does not have to do this prostration; and the same applies if he loses his wudoo’ -- and his prayer is valid.
And Allah knows best.