Jabir bin Abdullah reported,

The Prophet ﷺ used to refuse to pray over a man who had outstanding debts. A deceased person was brought to him, and he asked, "Does he have any debt?"They said, "Yes, he owes two dinars."He said, "Pray over your companion."Abu Qatada said, "They are upon me, Messenger of Allah."So he prayed over him. Later, when Allah granted victories to His Messenger ﷺ, he said, "I am closer to every believer than his own self. Whoever leaves behind a debt, it is upon me to settle, and whoever leaves behind wealth, it belongs to his heirs."

Nasai 1964

Sahih

أخبرنا نوح بن حبيب القومسي قال حدثنا عبد الرزاق قال أنبأنا معمر عن الزهري عن أبي سلمة

عن جابر قال

كان النبي ﷺ لا يصلي على رجل عليه دين فأتي بميت فسأل أعليه دين قالوا نعم عليه ديناران قال صلوا على صاحبكم قال أبو قتادة هما علي يا رسول الله فصلى عليه فلما فتح الله على رسوله ﷺ قال أنا أولى بكل مؤمن من نفسه من ترك دينا فعلي ومن ترك مالا فلورثته

النسائي 1964صحيح
Contents
Reference
Commentary
Ayat
Collection
Sunan Nasai Sughra
Book
Funerals
Chapter
Prayer for one who has debt
Numbering
Darussalam 1964
Nasai 1964