Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:12:50

And the king said, "Bring him to me." But when the messenger came to him, ˹Joseph˺ said, "Return to your master and ask him what is the case of the women who cut their hands. Indeed, my Lord is Knowing of their plan."  

And the king, after the messenger had come to him and informed him of its ˹the dream’s˺ interpretation, said: ‘Bring him to me!’, that is, the one who interpreted it. And when the messenger came to him, that is, ˹to˺ Joseph, and summoned him in order to depart ˹from the prison˺, he said — with the intention of manifesting his innocence — ‘Return to your lord and ask him, to inquire: “What of, ˹what was˺ the case with, the women who cut their hands?” Surely my lord, my master, has knowledge of their guile’; he ˹the messenger˺ thus returned and informed the king, who then summoned them ˹the women˺.
القرآن:١٢:٥٠

وَقَالَ الْمَلِكُ ائْتُونِي بِهِ ۖ فَلَمَّا جَاءَهُ الرَّسُولُ قَالَ ارْجِعْ إِلَىٰ رَبِّكَ فَاسْأَلْهُ مَا بَالُ النِّسْوَةِ اللَّاتِي قَطَّعْنَ أَيْدِيَهُنَّ ۚ إِنَّ رَبِّي بِكَيْدِهِنَّ عَلِيمٌ  

{وقال الملك} لما جاءه الرسول وأخبره بتأويلها {ائتوني به} أي بالذي عبرها {فلما جاءه} أي يوسف {الرسول} وطلبه للخروج {قال} قاصدا إظهار براءته {ارجع إلى ربك فاسأله} أن يسأل {ما بال} حال {النسوة اللاتي قطعن أيديهن إن ربي} سيدي {بكيدهن عليم} فرجع فأخبر الملك فجمعهن.