The Prophet (PBUH) has forbidden the killing of Abul-Bakhtari Ibn Hisham, but at the time he should take advantage of this. He decided to die with his friend.
When he fought with Al-Mujadhdhar Ibn Dhiyad, who had told him that the Prophet has said to them not to kill him. He asked whether his friend – Junadah Ibn Mulaihah was also forbidden to be killed.
Which is no, in order to not save only himself and with his love for his friend. He doesn’t let go and stay fighting till he died.
And do you know why the Prophet(PBUH) has ordered not to kill him? Because he didn’t do anything to harm the Prophet (PBUH) nor the Muslims.
This was explained in this narration.
Ibn Ishaq related that the Messenger of Allah, peace and blessings of Allah be upon him, had forbidden that Abul-Bakhtari is killed because he was the most abstentious of people from (harming) Allah’s Messenger while he was in Makkah.
He neither participated in hurting him nor did anything distasteful that would reach the Prophet. He was one of those who executed the repudiation of the boycott.
AlMujadhdhar Ibn Dhiyad Al Balawi, an ally of the Ansar met him one day and said: “Allah’s Messenger has forbidden us from killing you.” Meanwhile, Abul Bakhatari was with a friend who had travelled with him from Makkah, his name was Junadah Ibn Mulaihah. So he asked: “What about my friend?”
“I shall not let your friend go for the Messenger of Allah commanded us regarding you only.” Abul-Bakhtari said: “No, by Allah, then I and he shall both die together. I do not like that the women of the Quraish talk about me that I abandon my friend in my covetousness of life.
Then AbulBakhatari said: I shall not surrender a free-born friend Until he dies or he is let off So they fought and Al-Mujadhdhar Ibn Dhiyad killed him.
In short, Abul-Bakhtari Ibn Hisham died fighting with Al-Mujadhdhar Ibn Dhiyad who has already told him the Prophet (PBUH) has forbidden his killing. However, in order not to live his friend at the time. He ends up fighting till he died.