It was narrated from ‘Abdur-Rahman Al-A’raj that Ibn Buhainah told him that the Prophet ﷺ stood up in the second Rak’ah of Zuhr and forgot to sit. When he had finished his prayer, and before he said the Salam, he performed the two prostrations for forgetfulness (Sahw) and said the Salam.
أَخْبَرَهُ أَنَّ النَّبِيَّ ﷺ قَامَ فِي ثِنْتَيْنِ مِنَ الظُّهْرِ نَسِيَ الْجُلُوسَ حَتَّى إِذَا فَرَغَ مِنْ صَلاَتِهِ إِلاَّ أَنْ يُسَلِّمَ سَجَدَ سَجْدَتَىِ السَّهْوِ وَسَلَّمَ