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:9:65

And if you ask them, they will surely say, "We were only conversing and playing." Say, "Is it Allah and His verses and His Messenger that you were mocking?"  

And if (la-in: the lām is for oaths) you question them, about their mockery of you and of the Qur’ān while they were journeying with you towards Tabūk, assuredly they will say, making excuses: ‘We were only engaging ˹in idle talk˺ and jesting’, in conversation, in order to pass ˹the time of˺ the road, and we did not mean it. Say, to them: ‘Were you then mocking God, and His signs, and His Messenger?
القرآن:٩:٦٥

وَلَئِنْ سَأَلْتَهُمْ لَيَقُولُنَّ إِنَّمَا كُنَّا نَخُوضُ وَنَلْعَبُ ۚ قُلْ أَبِاللَّهِ وَآيَاتِهِ وَرَسُولِهِ كُنْتُمْ تَسْتَهْزِئُونَ  

{ولئن} لام قسم {سألتهم} عن استهزائهم بك وبالقرآن وهم سائرون معك إلى تبوك {ليقولن} معتذرين {إنما كنا نخوض ونلعب} في الحديث لنقطع به الطريق ولم نقصد ذلك {قل} لهم {أبالله وآياته ورسوله كنتم تستهزئون}.