For those who die, the duty is waived. The sacrifice is not made on their behalf, because the sacrifice is addressed to the living who can afford the price of the sacrifice. For the one performing the sacrifice can share the reward of what he sacrifices with whom he wants from among his dead relatives. 

Some scholars permitted performing Hajj on behalf of the deceased, some permitted the prayers on their behalf for what was missed. The reality is that if the deceased could not afford to perform Hajj when he died, he has forfeited it, but if he could and did not, then he has died as a disobedient.

However, it was reported from the Prophet, may Allah’s peace and blessings be upon him, concerning fulfilment of the vow of a mother to perform Hajj and died before she could perform the Hajj. Then the prophet, may Allah’s peace and blessings be upon him, recommended fulfillment of her vow.. And he said to her daughter: “Did you see if your mother owed a debt aren’t you going to pay it? And she replied: Yes. The prophet, may Allah’s peace and blessings be upon him, said: “Allah’s debt is more worthy of fulfillment”.