Reference: al-Fataawa as-Sa’diyyah – Page 131, Question 29
Question: Is it permissible for the latecomer to [join the congregational prayer and then in the final tashahhud] stand and complete what he has missed of the prayer before the imaam has actually completed the [congregational] prayer?
Response: This is not permissible for him to do; He must remain seated until the imaam has completed [the prayer with] the second tasleem. And if he were to stand before the tasleem and does not [immediately] return [to join the imaam], then his prayer is [automatically] rendered a voluntary prayer and he is required to repeat the [obligatory] prayer; This is because the congregation [behind the imaam] are obligated to remain with the imaam [and follow him] until the imaam completes the prayer.