“If you ask them (about this), they declare: ‘We were only talking idly and joking.’ Say: ‘Was it at Allaah, and His Ayaat (proofs, evidences, verses, lessons, signs, revelations, etc.) and His Messenger that you were mocking?’
Make no excuse; you disbelieved after you had believed”
[al-Tawbah 9:65-66]
Ibn Taymiyah (may Allaah have mercy on him) said: “Making fun of Allaah, His Signs and His Messenger is kufr (disbelief) and the one who does that disbelieves thereby after he had believed.”
The Prophet (peace and blessings of Allaah be upon him) said: “Woe to the one who tells lies to make people laugh, woe to him.” (Narrated by Abu Dawood).
The Prophet (peace and blessings of Allaah be upon him) said, warning against this kind of behaviour which some jokers are accustomed to: “A man may say something to make his companions laugh, and he will fall into Hell as far as the Pleiades because of it.” (Narrated by Ahmad).
It was narrated that Abu Layla said: “The companions of Muhammad (peace and blessings of Allaah be upon him) said that they were travelling with the Prophet (peace and blessings of Allaah be upon him), and a man among them fell asleep. Some of them got a rope and tied him up, and he got scared. The Messenger of Allaah (peace and blessings of Allaah be upon him) said: ‘It is not permissible for a Muslim to frighten another Muslim.’” (Narrated by Abu Dawood).
https://islamqa.info/en/22170