"The Messenger of Allah ﷺ said the salam then he performed two prostrations of forgetfulness while he was still sitting, then he said the salam." He said: He mentioned it in the hadith of Dhul-Yadain. (Using translation from Nasāʾī 1330)
أَنَّ رَسُولَ اللهِ ﷺ «سَلَّمَ ثُمَّ سَجَدَ سَجْدَتَيِ السَّهْوِ وَهُوَ جَالِسٌ ثُمَّ سَلَّمَ» قَالَ ذَكَرَهُ فِي حَدِيثِ ذِي الْيَدَيْنِ