All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger.
The scholars stated that mocking one of the rituals of Islam is Kufr (disbelief) even if the person who does so is joking. Ibn Qudaamah said in Al-Mughni: “If a person insults Allaah Almighty, then he has committed Kufr, whether he does so seriously or jokingly. The same applies to the person who mocks Allaah, the Exalted, His verses, His Books or His Messengers. Allaah Almighty says (what means): {And if you ask them, they will surely say, "We were only conversing and playing." Say, "Is it Allaah and His verses and His Messenger that you were mocking?" Make no excuse; you have disbelieved after your belief.}[Quran 9:65-66]”
For more benefit, please refer to Fatwa 23340.
Ibn Al-‘Arabi said in his interpretation of the above verse: “Such things are said either seriously or jokingly, but in both cases it is Kufr. Joking with words of Kufr is Kufr and there is no difference of opinion among the scholars about it. Saying something seriously is akin to knowledge and truth, and saying something jokingly is akin to falsehood and ignorance. So if a person mocks Allaah, or mocks the Prophet or mocks the religion, while he is in a sound mind and is not forced to do so, then he becomes a disbeliever, and this is considered apostasy...”
Ibn Taymiyyah said: “Allaah informed them that they disbelieved after they had believed even though they said that they uttered words of Kufr without believing in them; rather they said we were just joking and playing, and Allaah clarified that mocking the signs of Allaah is Kufr, and that this cannot be said except by a person who finds these words acceptable. If he had belief in his heart, this would have prevented him from speaking such words.”
Therefore, if joking includes mocking a religious rite, then it is Kufr regardless of the intention of the sayer. However, if he did not intend to mock the Sharee’ah but rather to mock the person who represents it for another consideration, then he is not accused of Kufr. Shaykh Ibn ‘Uthaymeen said in answer to a question about the ruling on someone who mocks the people who abide by the religion of Allaah: “Mocking the Sharee’ah is Kufr, but if they mock them (some Muslims) because of their personality or their dress regardless of their following the Sunnah, then they do not become disbelievers by this because a person may mock another person regardless of his deeds and actions, but they are still in great danger; rather, it is an obligation to encourage and help those who abide by the Sharee’ah of Allaah, and guide them if they commit a mistake so that they would correct their mistake.”
Anyway, a Muslim should avoid errors of the tongue in any case, because giving free rein to the tongue may lead to destruction. Abu Hurayrah narrated that he heard the Prophet saying: “A person may utter a word thoughtlessly and, as a result, he will plummet into the fire of Hell deeper than the distance between the east and the west.”” [Al-Bukhari and Muslim]
Finally, what you feel is not necessarily a kind of Waswaas (obsessive whispering), but be careful that thinking about this matter too much does not lead to you having Waswaas or doubts based on minor reasons or any notion that comes to mind.
Allaah Knows best.