it is granted while the testator is in his final illness or after his death…
Among the rulings on bequests is that they are recommended only for someone who possesses ample wealth and whose heirs are not in need. The Exalted says, “Prescribed for you, when death approaches any of you, if he leaves wealth, is that he make a bequest” ⦗2:180⦘. By common usage, “wealth” here refers to a sizable fortune. Consequently, it is disliked for a person of modest means whose heirs are needy to leave a bequest, for in doing so he diverts what his destitute relatives require to outsiders. The Messenger of Allah ﷺ said to Saʿd ibn Abī Waqqāṣ, “No wealth brings a greater reward than the wealth a man leaves to his children, by which he makes them independent of others.” ʿAlī once told a man, “You have only left a small amount; leave it to your heirs.” Many of the Prophet’s Companions ﷺ in fact made no bequests at all.
If the testator’s intention is to harm or restrict an heir, that is unlawful and sinful, for Allah says, “…without causing harm…” ⦗4:12⦘.
The Prophet ﷺ warned, “A man may obey Allah for sixty years, then when death approaches he harms others in his bequest, and the Fire becomes his due.” Ibn ʿAbbās said, “To cause harm in—"