Answered by Sidi Fadi Qutub Zada
I was saying my Maghrib Prayer with Jamat… I joined the second Rakat… but when the prayer was about to end … Imam perform Sajdah Sahw but I had to complete my missing Rakat… so I did not say salam but performed two sajdah… after then I completed my prayer. I want to ask that was my prayer correct or not?
In the name of Allah, most Gracious and Merciful
You were right in following the imam in the forgetfulness prostration (sujud sahw), and your prayer is correct.
Imam al-Tumurtashi says in his book Tanweer al-Absar:
And one who comes late to a group prayer performs the forgetfulness prostration with the imam in all circumstances, then makes up what was missed.
Imam Ibn Abidin comments on his words by saying:
He restricted (the following of the imam) to be only in the forgetfulness prostration, because one does not follow him in the tasleem. Rather, one performs the forgetfulness prostration with the imam and reads the tashahhud, and when the imam makes tasleem one gets up to make up what was missed. [Hashiyat Ibn Abidin 1:499]