The Funeral Prayer for One Who Dies in Debt
If a person is in debt and dies before repaying it, his funeral prayer is without doubt to be performed, because he is a Muslim, and it is the responsibility of the Islamic ruler to repay his debt from the Bayt al-Mal (public treasury). The Messenger of Allah ﷺ said:
ومن ترك دينا أو ضياعا فلياتني فانا مولاه
“Whoever leaves behind a debt or leaves behind children, they should come to me, for I am their guardian.”
[Sahih al-Bukhari: 2399, Kitab al-Istiqrad wa Ada’ al-Duyun: Bab al-Salah ‘ala man taraka dayn]