The Messenger of Allah ﷺ ended the prayer after two units, so Dhul-Yadayn said to him, "Has the prayer been shortened, Messenger of Allah, or did you forget?"The Prophet ﷺ asked, "Is Dhul-Yadayn telling the truth?"The people answered, "Yes."So the Messenger of Allah ﷺ stood and prayed the remaining two units, then made the closing salutation. Then he said the takbir and prostrated like his usual prostration or longer, then raised his head, then said the takbir and prostrated again like his usual prostration, then raised his head.
حدثنا إسماعيل حدثني مالك عن أيوب عن محمد
أن رسول الله ﷺ انصرف من اثنتين فقال له ذو اليدين أقصرت الصلاة يا رسول الله أم نسيت فقال أصدق ذو اليدين فقال الناس نعم فقام رسول الله ﷺ فصلى ركعتين أخريين ثم سلم ثم كبر ثم سجد مثل سجوده أو أطول ثم رفع ثم كبر فسجد مثل سجوده ثم رفع