Abu Hurairah reported,

The Messenger of Allah ﷺ stood for prayer and we stood with him. While in the prayer, an Arabi said, "O Allah, have mercy on me and on Muhammad, and do not extend Your mercy to anyone else along with us."When the Prophet ﷺ finished the prayer, he said to the Arabi, "You have restricted something vast," meaning the mercy of Allah.

Azami 2593

Sahih

عن أبي هريرة قال

قام رسول الله ﷺ في صلاة وقمنا معه، فقال أعرابي وهو في الصلاة: اللهم ارحمني ومحمدا ولا ترحم معنا أحدا. فلما سلم النبي ﷺ قال للأغرابي: لقد حجرت واسعا يريد رحمة الله.

الأعظمي 2593صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Prayer
Chapter
What is prohibited and disliked in prayer
Section
Abrogation of speaking during prayer
Numbering
Jami al-Kamil 2593 (2nd edition)
Azami 2593