Saad bin Abu Waqqas reported,

The Messenger of Allah ﷺ said, "The Muslim who commits the greatest offense against the Muslims is one who asks about a matter that was not forbidden, and it then becomes forbidden upon the people because of his question."

Azami 1289

Sahih

عن سعد بن أبي وقاص، قال

قال رسول الله ﷺ: أعظم المسلمين في المسلمين جرما من سأل عن أمر لم يحرم فحرم على الناس من أجل مسألته.

الأعظمي 1289صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Knowledge
Chapter
Warnings in matters of knowledge
Section
Prohibition of excessive questioning about what has not occurred and about which no revelation has been sent down
Numbering
Jami al-Kamil 1289 (2nd edition)
Azami 1289