Sunan an Nasai 1329
The Book of Forgetfulness (In Prayer)
أَخْبَرَنَا مُحَمَّدُ بْنُ آدَمَ، عَنْ حَفْصٍ، عَنِ الأَعْمَشِ، عَنْ إِبْرَاهِيمَ، عَنْ عَلْقَمَةَ، عَنْ عَبْدِ اللَّهِ، أَنَّ النَّبِيَّ صلى الله عليه وسلم سَلَّمَ ثُمَّ تَكَلَّمَ ثُمَّ سَجَدَ سَجْدَتَىِ السَّهْوِ .
It was narrated from 'Abdullah that:The Prophet (ﷺ) said the salam, then he spoke, then he performed two prostrations of forgetfulness
Grading: Abu Ghuddah: Sahih · Al-Albani: Sahih · Zubair Ali Zai: Sahih Muslim
Text from the public-domain hadith-api dataset. Numbering follows that dataset and can differ by a few from some printed editions — check the wording, not only the number.