The Messenger of Allah ﷺ established a bond of brotherhood between two men. One of them was killed, and the other died about a week later. We performed the funeral prayer over him, and the Messenger of Allah ﷺ asked, "What did you say?"We replied, "We supplicated for him and said, 'Allah, forgive him and join him with his companion.'"The Messenger of Allah ﷺ said, "But what about his prayers performed after his companion's prayers, his fasting after his companion's fasting," Shuba was uncertain about the mention of fasting, "and his deeds after his companion's deeds? Indeed, the difference between them is as vast as that between the heavens and the earth."
حدثنا محمد بن كثير أخبرنا شعبة عن عمرو بن مرة قال سمعت عمرو بن ميمون عن عبد الله بن ربيعة
آخى رسول الله ﷺ بين رجلين فقتل أحدهما ومات الآخر بعده بجمعة أو نحوها فصلينا عليه فقال رسول الله ﷺ ما قلتم فقلنا دعونا له وقلنا اللهم اغفر له وألحقه بصاحبه فقال رسول الله ﷺ فأين صلاته بعد صلاته وصومه بعد صومه شك شعبة في صومه وعمله بعد عمله إن بينهما كما بين السماء والأرض
Sourcing, hasan, and Nasai reported it in the Book of Funerals, Chapter on Supplication, no. 1987, from the hadith of Shubah through the same chain. Abdullah bin Rabia was declared trustworthy by Ibn Hibban, though there is disagreement about whether he was a companion. Someone of his standing, his hadith is hasan.