The Messenger of Allah ﷺ said two rak'ahs of the noon prayer and then gave salutation when a man from Band Sulaim came to him and said: Messenger of Allah. has the prayer been shortened, or have you forgotten? -and the rest of the hadith is the same.
أَنَّ رَسُولَ اللَّهِ ﷺ صَلَّى رَكْعَتَيْنِ مِنْ صَلاَةِ الظُّهْرِ ثُمَّ سَلَّمَ فَأَتَاهُ رَجُلٌ مِنْ بَنِي سُلَيْمٍ فَقَالَ يَا رَسُولَ اللَّهِ أَقُصِرَتِ الصَّلاَةُ أَمْ نَسِيتَ وَسَاقَ الْحَدِيثَ