It was narrated from Ibn ‘Umar that the Messenger of Allah (ﷺ) forgot and said the Taslim after two Rak’ah. A man who was called Dhul-Yadain said to him:
‘O Messenger of Allah, has the prayer been shortened or did you forget?’ He said: ‘It has not been shortened and I did not forget.’ He said: ‘But you prayed two Rak’ah.’ He said: ‘Is what Dhul-Yadain says true?’ They said: ‘Yes.’ So he went forward and performed two Rak’ah and said the Salam, then he prostrated twice for prostrations of forgetfulness.