Aamir bin Sa’d narrated from his father that the Prophet ﷺ said: “Indeed, the greatest offender among the Muslims is the one who asked about something that was not forbidden, and because of his question, it was made forbidden.”
Hadith Referenceمسند الإمام الشافعي / كتاب فضائل قريش وغيرهم وأبواب متفرقة / 1799
Hadith Takhrijاخرجه مسلم ، الفضائل، باب توقیره ، وترك اكثار سؤاله عما لا ضرورة .... الخ (2358)۔