The scholars differed concerning one who gives his zakaah to one who is well off, thinking that he is poor. The Shaafa’is are of the view that it does not count as such. See al-Majmoo’ (6/225).
The Hanbalis are of the view that it does count, and this is the correct view.
This is indicated by the report narrated by al-Bukhaari (1421) and Muslim (1022) from Abu Hurayrah (may Allaah be pleased with him), that the Messenger of Allaah (peace and blessings of Allaah be upon him) said: “A man said, ‘I am going to give charity’ … He went out with his charity and placed it in the hand of a rich man. The next morning, they said, ‘Last night he gave charity to a rich man.’ He said: ‘O Allaah, to You be praise for a rich man. … It was said to him: ‘As for your charity, it has been accepted. … As for the rich man, perhaps he will learn a lesson and spend from that which Allaah has given him.”
A person’s poverty may not be apparent, so it is sufficient for the one who is giving zakaah to think that he most likely poor. Allaah says (interpretation of the meaning):
“The one who knows them not, thinks that they are rich because of their modesty. You may know them by their mark, they do not beg of people at all”
Al-Bahooti said in Kashshaaf al-Qinaa’ (2/296): If he gives him zakaah thinking that he is poor then he turns out to be well off, that is still valid. End quote.
Does the same ruling apply in all cases where he gives zakaah to people thinking that they are entitled to it, then he finds out that they were not entitled to it, such as one who gives his zakaah to a kaafir, thinking that he is a Muslim, or he gives it to a poor man, the finds out that he is one of the descendents of the Prophet (peace and blessings of Allaah be upon him)?
The Hanbalis are of the view that it dos not count as zakaah in these cases, because in most cases such things are not hidden from people, unlike poverty, which may be hidden. See al-Mughni (2/281).
Shaykh Ibn ‘Uthaymeen favoured the view that it does count as zakaah in these cases. He said in al-Sharh al-Mumti’ (6/265): If he gives it to someone who he thinks is entitled to it after checking on him, then he finds out that he was not entitled to it, that still counts as zakaah, because he feared Allaah as much as he could, and Allaah says (interpretation of the meaning):
“Allaah burdens not a person beyond his scope”
What counts in acts of worship is what the person thinks, unlike interactions with others, where what counts is the reality of the transaction, not what the person thinks.