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:51:39

But he turned away with his supporters and said," A magician or a madman."  

but he turned away, he rejected belief, to his supports (bi-ruknihi), his hosts, ˹so called˺ because to him they are like a support ˹rukn˺, saying, to Moses that he ˹Moses˺ was: ‘A sorcerer, or a madman!’
القرآن:٥١:٣٩

فَتَوَلَّىٰ بِرُكْنِهِ وَقَالَ سَاحِرٌ أَوْ مَجْنُونٌ  

{فتولى} أعرض عن الإيمان {بركنه} مع جنوده لأنهم له كالركن {وقال} لموسى هو {ساحر أو مجنون}.