The Prophet ﷺ led them in prayer and made a mistake, so he performed two prostrations and then gave the salam.
أخبرنا محمد بن يحيى بن عبد الله النيسابوري قال حدثنا محمد بن عبد الله الأنصاري قال أخبرني أشعث عن محمد بن سيرين عن خالد الحذاء عن أبي قلابة عن أبي المهلب
أن النبي ﷺ صلى بهم فسها فسجد سجدتين ثم سلم
[Its chain of transmission is sahih] Abu Dawud narrated it in the Book of Prayer, Chapter on the two prostrations of forgetfulness having a tashahhud and a taslim, hadith 1039, and Tirmidhi in the Book of Prayer, Chapter on what has been said about the tashahhud in the two prostrations of forgetfulness, hadith 395, from Muhammad bin Yahya Nisaburi through this same chain, and he said, hasan gharib sahih. It also appears in Al-Kubra, hadith 1159. Ibn Khuzayma graded it sahih, hadith 1062, as did Ibn Hibban, hadith 536, and Hakim, according to the standard of the two Shaykhs, 1/323, and Dhahabi agreed with him.Ashath here is Ibn Abdul-Malik, and the hadith has a flaw that does not affect its validity, which I have mentioned in Nayl al-Maqsud.