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:81:22

And your companion is not ˹at all˺ mad.  

And your companion, Muhammad (s) (wa-mā sāhibukum: a supplement to ˹the clause from˺ innahu, ‘truly this is’, up to the last of the oath clauses) is not a madman, as you claim.
القرآن:٨١:٢٢

وَمَا صَاحِبُكُمْ بِمَجْنُونٍ  

{وما صاحبكم} محمد ﷺ عطف على إنه إلى آخر المقسم عليه {بمجنون} كما زعمتم.