ʿAbd al-Rahman ibn Muljam al-Murādiyy (Arabic: عبدالرحمن بن ملجم المرادي) was a Khariji known for assassinating Ali, the fourth Caliph of Islam.
We need first to define the meaning of Premature death. Because no one dies before his time. That does not mean that every death is Natural. Those who are killed have died in their own time of death. Those who died as victims of a crime of killing, died in their own time of death. We differ with some Non-Muslims who claim that there is a Premature death which means as they claim, that a person who is killed has died before his time of death. They Think that the age which is for certain age group is the maturity for death. Anyone dies before that maturity age as they claim has died Prematurely. This is their own opinion which does not come along with what we read in Quran and Authentic Hadeeths. “Wa Ma Kana Le Nafsin An Tamouta Ella Bi ‘ithnillah Kitaaban Mo’ajjala” ( 3:145)– No one dies but only by permission of Allah, according to written time”
The way of dying can be Natural, and can be a Crime, and can be any other way. Time is written by Allah on everyone from us. Prophet Yahya (AS) was killed by a tyrant of His time instigated by a bad woman from Bani Israeel. Allah knew that such crime will happen, but the knowledge of Allah about a Crime which is to take place does not mean that Allah has permitted the killing. Allah (SWT) informed the Prophet Muhammad (peace be upon him and His Holy Progeny) that His grandson Hussain will be killed in Karbala. Also informed him that Ameerul Mo'mineen Ali (A.S.) will be killed by Ibne Muljim in Kufa. That does not mean that Allah has permitted the Crime at all.
Thank you for your question. The Prophets (as) and the Imams (as) are commanded to abide by the outward nature of the divine law and for that reason they cannot punish someone before a crime even if they know that crime will be committed.
On the other hand, as is clear from the verses concerning Khidhr, he is not ordered to conform to the same rules and so his responsibility differs from that of the Imams (as). Khidrs actions were not independent of the Will of God and that is why he is not blamed in the Qur'an.
May you always be successful
The high level of self-restraint that Imam Ali (a.s.) had towards those who wrong Islam and him personally can be seen in many events during his life.
This also embodied in the last days of his noble life when although he was suffering from the painful strike of Ibn Muljam's poisoned sword, he still made sure the perpetrator was treated with compassion and fairness.
The details of this can be read in:
Sheikh al-Mufid's Kitab al-Irshad [The Book of Guidance], biography of Imam Ali (a.s.).
Bihar al-Anwar, vol. 42, p. 288.