Abdullah bin Abbas reported,

Some people used to question the Messenger of Allah ﷺ mockingly. One man would ask, "Who is my father?" Another whose camel had wandered off would ask, "Where is my camel?" So Allah revealed concerning them this verse, "You who believe, do not ask about things which, if shown to you, would distress you" [Maidah 5:101], until the end of the verse.

Bukhari 4622

Sahih

حدثنا الفضل بن سهل حدثنا أبو النضر حدثنا أبو خيثمة حدثنا أبو الجويرية

عن ابن عباس رضي الله عنهما قال

كان قوم يسألون رسول الله ﷺ استهزاء فيقول الرجل من أبي ويقول الرجل تضل ناقته أين ناقتي فأنزل الله فيهم هذه الآية {يا أيها الذين آمنوا لا تسألوا عن أشياء إن تبد لكم تسؤكم} حتى فرغ من الآية كلها

البخاري 4622صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Tafsir
Chapter
His saying, "Do not ask about things which, if made plain to you, may cause you trouble"
Numbering
Darussalam 4622
Bukhari 4622