Answered by Ustadh Tabraze Azam
Question: Assalam ‘aleykum.
If the Imam stood up after the last sitting for an extra cycle and the follower stood up with him then, is the prayer of the follower invalid? What about a latecomer?
Answer: Assalamu alaikum wa rahmatullah,
I pray that this message finds you well, insha’Allah.
If the imam stands for an extra cycle (rak`at) of the prayer, the follower should remain seated and remind the imam to sit down by making some form of remembrance (dhikr), such as “SubhanAllah.”
Then, there are two cases:
(1) If he sat for the final sitting, then stood for the extra cycle and prostrated, the follower would simply exit the prayer on his own by saying the salams.
(2) If he did not sit for the final sitting, but stood for the extra cycle and prostrated, then the prayer of all would be nullified, and they would need to repeat it.
[Shurunbulali, Maraqi al-Falah, with Tahtawi’s Gloss]
And consider taking the following free class at SeekersHub: Absolute Essentials of Islam: Basic Hanafi Jurisprudence (STEP)
Please see also: The Rulings Related To A Latecomer & A Note On The Durr al-Mukhtar
And Allah alone knows best.
Checked & Approved by Shaykh Faraz Rabbani