A haram wasiyyah (instructions given by one who is dying)
Question

I had a problem with my grandmother when she was sick. She said to me: “This is my wasiyyah (instructions) to you” in front of my maternal aunt and her daughters. The wasiyyah said: “I do not want to see you when I am alive or when I am dead, not when they wash my body, not when they bury me and not when people gather to offer condolences to the family. I disavow you until the Day of Judgement. I wish that you had died with your mother and that I never laid eyes on you.” What is the ruling on this wasiyyah?
Praise be to Allah.Firstly:
If you were innocent of this accusation and you did not touch anything of her wealth, then you have nothing to worry about and her claims will not harm you. You should be patient and seek reward with Allah, for Allah has made a promise to those who are patient, as He says (interpretation of the meaning):
{but give good tidings to the patient
Who, when disaster strikes them, say, “Indeed we belong to Allah, and indeed to Him we will return.”
Those are the ones upon whom are blessings from their Lord and mercy. And it is those who are the [rightly] guided} [al-Baqarah 2:155-157].
Secondly:
A wasiyyah giving instructions to prevent someone from visiting a person when he is alive or from attending his burial and condolence gathering if he dies is a haram kind of wasiyyah, because of what it includes of calling for severing ties of kinship. Hence it does not have to be carried out.
It is not obligatory to carry out any wasiyyah except that which instructs people to do righteous deeds.
Ibn Rushd (may Allah have mercy on him) said: There is no obligation to carry out a wasiyyah except one which gives instructions to do righteous deeds."(Al-Bayan wa’t-Tahsil  2/287).
Khalil said in his Mukhtasar: The wasiyyah is invalid if the person apostatizes or if it gives instructions to commit sin. End quote.
It says in Minah al-Jalil (9/512): [The wasiyyah] is invalid if it gives instructions to commit sin, such as if the person bequeaths money to one who will use it to buy wine and drink it, or to kill someone whose life is protected by Islamic law, or to wail for him. End quote.
The jurists stipulated that the instructions given in the wasiyyah should not involve sin, as was narrated above from the jurists.
It says in al-Mawsu‘ah al-Fiqhiyyah (43/258), on the topic of conditions regarding instructions given in a wasiyyah:
The instructions should not involve sin or anything that is prohibited according to Islamic teachings:
51. The purpose of giving instructions before death (wasiyyah) is to make up for what the person has missed of righteous deeds during his lifetime, so it is not permissible for the instructions to involve any sin. End quote.
Moreover, when the jurists speak of wasiyyah, they speak of bequeathing wealth that has value, or whatever comes under the same heading. [See: al-Mawsu‘ah al-Fiqhiyyah (43/254-258)]. Based on that, this and similar questions do not come under the heading of wasiyyah at all. The purpose behind quoting the words of the jurists here is to highlight that the fact that they stated that it is haram to give any instructions that involve sin indicates that such behaviour is not allowed. Moreover, this kind of instruction does not come under the heading of the wasiyyah that the jurists usually discuss at all, even if there is no sin involved. So how about if the wasiyyah involves sin and an attempt to assert control that serves no purpose for the deceased whatsoever; in fact it comes under the heading of mischief that would lead to more enmity and rancour, and calls for sin and severing ties of kinship, as is quite obvious?
Conclusion:
These instructions to prevent someone from attending the funeral of the deceased or praying for him, and the like, do not come under the heading of wasiyyah as it is known in Islamic teachings, which must be carried out. Rather they are more akin to sin and severing ties of kinship, as may be understood from the question. The deceased has no right to do that and there is no interest to be served by it, in addition to what it involves of depriving the deceased of supplication for him and prayers for his forgiveness. All of that is prohibited.
And Allah knows best.