The Prophet ﷺ led them in prayer and made a mistake, so he performed two prostrations, then recited the tashahhud, then gave the salam.
حدثنا محمد بن يحيى النيسابوري حدثنا محمد بن عبد الله الأنصاري قال أخبرني أشعث عن ابن سيرين عن خالد الحذاء عن أبي قلابة عن أبي المهلب
أن النبي ﷺ صلى بهم فسها فسجد سجدتين ثم تشهد ثم سلم
[Its isnad is sahih] Abu Dawud transmitted it in the Book of Prayer, Chapter on the Two Prostrations of Forgetfulness Having a Tashahhud and Tasleem, hadith no. 1039, from the hadith of Ansari through the same chain. Ibn Khuzayma graded it sahih, hadith no. 1062, as did Ibn Hibban, hadith no. 536, and Hakim, according to the criteria of the two Sheikhs, 1/323, and Dhahabi concurred with him. It was criticized on a ground that does not undermine it.