Whoever prostrated thinking that the Imam had made the Prostration of Forgetfulness
Question :
We were praying the Maghrib prayer in congregation and during the last Tashahhud in the third Rak'ah, the Imam made Takhir and then stood up to pray another Rak'ah... some of the worshippers did not notice that the Imam had stood up and they prostrated, thinking that the Imam had made the Takbir for the prostration of forgetfulness, then when they sat up from the prostration, they found the Imam sitting because he heard the people saying 'Subhan Allah,' and then the Imam prostrated twice.
It then became clear to some of the worshippers after the Taslim, that they had prostrated three times. What is the ruling on the prayer in these circumstances? And what is the ruling on the third prostration performed by some of the worshippers?
Answer:
There is no sin upon the one who prostrated thinking that it was the Imam's prostration of forgetfulness and his prayer is correct, since he did not perform the extra one in his prayer intentionally; he only did so in the belief that he was following the Imam.
Source:
Ibn Baz
Fatawa Islamiyah, Vol. 2 Pages 269-270