The Prophet ﷺ said, "The most sinful person among the Muslims is the one who asked about something which had not been prohibited, but was prohibited because of his asking."
أَنَّ النَّبِيَّ ﷺ قَالَ إِنَّ أَعْظَمَ الْمُسْلِمِينَ جُرْمًا مَنْ سَأَلَ عَنْ شَىْءٍ لَمْ يُحَرَّمْ فَحُرِّمَ مِنْ أَجْلِ مَسْأَلَتِهِ