Amir bin Sa'd reported on the authority of his father that Allah's Messenger (ﷺ) said: The greatest sinner amongst the Muslims is one who asked about a thing (from Allah's Apostle) (ﷺ) which had not been forbidden for the Muslims and it was forbidden for them because of his persistently asking about it.
Related hadith on this topic