If a person does the prostration of forgetfulness after the salaam, then he has to say the salaam again, but he does not have to recite the tashahhud again.
al-Bukhaari (482) and Muslim (573) narrated that Muhammad ibn Sireen said: Abu Hurayrah (May Allaah be pleased with him) said: The Messenger of Allaah (peace and blessings of Allaah be upon him) led us in one of the afternoon prayers, either Zuhr or ‘Asr, and he said the tasleem after two rak’ahs. Then he went to a plank in the qiblah of the mosque and leaned against it, looking angry. Among the people were Abu Bakr and ‘Umar, but they were too afraid to speak. The people left quickly, saying that the prayer had been shortened. Then Dhu’l-Yadayn stood up and said: O Messenger of Allaah, has the prayer been shortened or did you forget? The Prophet (peace and blessings of Allaah be upon him) looked to his right and his left, then he said: “What did Dhu’l-Yadayn say?” They said: He is right, you only prayed two rak'ahs. So he prayed two more rak’ahs and said the tasleem, then he said takbeer and prostrated, then he said takbeer and sat up, then he said takbeer and prostrated, then he said takbeer and sat up. It was narrated that ‘Imraan ibn Husayn said: Then he said the tasleem.
Muslim (574) narrated from ‘Imraan ibn Husayn (may Allaah be pleased with him) that the Messenger of Allaah (peace and blessings of Allaah be upon him) prayed ‘Asr and said the tasleem after three rak’ahs, then he went into his house. A man called al-Khirbaaq, who had long arms, stood up and said: O Messenger of Allaah! And he told him what he had done. He came out looking angry, dragging his cloak, and when he reached the people he said: “Is this one telling the truth?” They said: Yes. So he prayed one rak’ah, then he said the tasleem, then he prostrated twice, then he said the tasleem.
Shaykh Muhammad ibn Saalih ibn ‘Uthaymeen (may Allaah have mercy on him) said:
If the prostration comes after the salaam, then he has to say the salaam, then prostrate twice, then say the salaam.
But does he have to recite the tashahhud?
There is a difference of opinion among the scholars concerning this, but the correct view is that he does not have to say the tashahhud. End quote.
Fataawa Ibn ‘Uthaymeen (14/74).
The Standing Committee was asked: Should tashahhud be recited after the prostration of forgetfulness or not, whether one does the prostration of forgetfulness before the salaam or after?
It is not prescribed to recite the tashahhud after the prostration of forgetfulness if it is done before the salaam, without a doubt. If it is done after the salaam then there is a difference of opinion among the scholars, but the more correct view is that it is not prescribed because it is not mentioned in the saheeh ahaadeeth. End quote.
Fataawa al-Lajnah al-Daa’imah (7/148).