I was with the Prophet ﷺ when this verse was revealed to him, "You who believe, do not ask about things which, if made clear to you, would distress you" [Maidah 5:101].He said, "So we asked him," or he said, "Allah has servants who are neither prophets nor martyrs, yet the prophets and martyrs will envy them for their station and their nearness to Allah on the Day of Resurrection."Then he related the hadith in its entirety.
حدثنا عبد الرزاق أخبرنا معمر عن ابن أبي حسين عن شهر بن حوشب عن عبد الرحمن بن غنم
كنت عند النبي ﷺ فنزلت عليه {يا أيها الذين آمنوا لا تسألوا عن أشياء إن تبد لكم تسؤكم} قال فنحن نسأله أو قال لله عز وجل عباد ليسوا بأنبياء ولا شهداء يغبطهم النبيون والشهداء لمقعدهم وقربهم من الله يوم القيامة فذكر الحديث بطوله