All perfect praise be to Allah, The Lord of the worlds. I testify that there is none worthy of worship except Allah and that Muhammad is His slave and Messenger.
The scholars stated that both joking and seriousness in uttering words of Kufr (disbelief) are the same and that there is no difference between them.
Ibn Al-Qayyim said in I‘laam Al-Muwaqqi‘een’:
“Allah and His Messenger did not make joking an excuse that exempts a person from sin; rather, the person who says a word of disbelief is more deserving of punishment. Do you not see that Allah has excused the person who is forced to say the word of Kufr if his heart is reassured with faith while Allah did not excuse the person who is joking; Allah says (what means): {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?} [Quran 9:65]"
Therefore, what that man has done is very serious; saying that he is trying to test the other person is not an excuse for him because it is not with such obnoxious words that we test people.
If he thought that acting in that manner was permissible, then we hope that he would be excused because he misinterpreted the matter. It should be noted that there is a difference between the statement and the person who said it, and the statement may be Kufr while its sayer does not become a Kaafir (disbeliever), as we have already clarified in fatwas 8106 and 87963.
The issue of 'whoever does not declare a Kaafir to be a Kaafir becomes a Kaafir himself' is related to someone whose Kufr is confirmed with certainty.
We have already warned you in our previous fatwas against the danger of Waswaas (obsessive whispering) in regard to declaring someone to be a Kaafir and had clarified that you must be careful about it because of its evil consequences. So we emphasize here again that you should be cautious about it if you wish to be safe from this tribulation.
Allah knows best.