All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu ‘alayhi wa sallam, is His Slave and Messenger.
If someone who joins the congregational prayer late makes a mistake requiring performing Sujood Sahw (Prostration of Forgetfulness), then there are two possible cases:
First, that he makes this mistake while following the Imaam, i.e. after catching up with the Imaam before the Imaam finishes the prayer. In this case, he does not have to do Sujood Sahw according to the opinion of the majority of scholars, as the Imaam assumes the burden of the mistake on his behalf.
Second, that he makes this mistake after he stops following the Imaam (in the Rak‘ah which he prays individually) or that he forgetfully made Tasleem (Salaam) along with the Imaam. In this case, he has to do Sujood Sahw because he made the mistake while not following the Imaam.
Ibn Qudaamah wrote: “If the latecomer makes a mistake in the part of the prayer that he completes individually after the Imaam has offered his Tasleem, then he should perform Sujood Sahw according to the consensus of scholars. This is because as he stands up to complete what he has missed of the prayer after the Imaam recites Tasleem, he is no longer following the Imaam in the congregational prayer; he is praying individually and therefore the Imaam no longer assumes the responsibility of that for him. The same applies if he mistakenly follows the Imaam in making Tasleem. He should stand up, complete his prayer, and then perform Sujood Sahw after Tasleem, just like the person who prays individually.” [Al-Mughni]
The Shaafi‘i book Asna Al-Mataalib reads: “When the latecomer mistakenly says Tasleem with the Imaam, he should perform Sujood Sahw because he made that mistake after he had stopped following the Imaam.”
So it should be clear to you, dear brother, that the Imaam does not assume responsibility of the mistake for you if you mistakenly say Tasleem with him, because from the Imaam’s Tasleem you are no longer following him in the congregational prayer. You are praying individually and thus you have to perform Sujood Sahw.
Allaah Knows best.