The scholars differed concerning such cases. Some of them said that others may perform Hajj on his behalf and that will benefit him, and it will be as if he did Hajj for himself. Others said that no one can perform Hajj on his behalf, and even if people performed Hajj on his behalf a thousand times, it would not be accepted and would not discharge his duty. This view is correct, because this man failed to do an act of worship that was obligatory for him and should have been done straight away, with no excuse. So how can we make it up for him after his death after he neglected it? Now the estate has to do with the rights of the heirs – how can we deprive them of the costs of this Hajj, when it is not going to be accepted? This is what Ibn al-Qayyim (may Allaah have mercy on him) mentioned in Tahdheeb al-Sunan and this is also my view. If a person fails to do Hajj out of negligence when he is able to do it, no Hajj will ever count for him, even if the people do Hajj on his behalf a thousand times.
As for zakaah, there are some scholars who say that if a person dies and zakaah is paid on his behalf, that is sufficient, but the basic principle that I have mentioned implies that it does not discharge his duty of paying zakaah. But I think that the zakaah may be paid from the estate, because it has to do with the rights of the poor and those who are entitled to zakaah, unlike Hajj, the cost of which cannot be taken from the estate, because it does not have to do with anybody’s rights, whereas zakaah has to do with people’s rights. So zakaah should be given to those who are entitled to it, but that does not discharge the person’s duty, and he will be given the punishment of those who do not pay zakaah. We ask Allaah to keep us safe and sound.
The same applies to fasting. If it is known that this person did not fast and was negligent in making it up, then it cannot be made up on his behalf, because he was negligent and failed to do this act of worship, which is one of the pillars of Islam, with no excuse. If it is made up on his behalf it will not benefit him. The hadeeth of the Prophet (peace and blessings of Allaah be upon him), “Whoever dies owing fasts, his heir should fast on his behalf,” applies to one who has not been negligent, and with regard to the one who failed to make up missed fasts out of negligence with no legitimate shar’i excuse, what is the point of making it up on his behalf? End quote.