The Messenger of Allah ﷺ stood up during the prayer when he should have sat, so he prostrated twice while sitting, before the taslim. (Using translation from Nasāʾī 1223)
عَنْ رَسُولِ اللهِ ﷺ أَنَّهُ «قَامَ فِي الصَّلَاةِ وَعَلَيْهِ جُلُوسٌ فَسَجَدَ سَجْدَتَيْنِ وَهُوَ جَالِسٌ قَبْلَ التَّسْلِيمِ»