The Messenger of Allah ﷺ said, "If any man becomes bankrupt and another man finds his own goods with him intact, that man has a greater right to them than anyone else."
حدثنا قتيبة حدثنا الليث عن يحيى بن سعيد عن أبي بكر بن محمد بن عمرو بن حزم عن عمر بن عبد العزيز عن أبي بكر بن عبد الرحمن بن الحارث بن هشام
عن رسول الله ﷺ أنه قال أيما امرئ أفلس ووجد رجل سلعته عنده بعينها فهو أولى بها من غيره
Agreed upon (Bukhari and Muslim). Muslim also reported it in the Book of Sharecropping, chapter on one who finds what he sold in the possession of the buyer who has then gone bankrupt, and he has the right to reclaim it, hadith 1559, from Qutayba. Bukhari reported it, hadith 2402, from the hadith of Yahya bin Saeed Ansari, with the same chain.There are also narrations on this topic from Samura [Abu Dawud, hadith 3531] and Ibn Umar [Ibn Hibban (Mawarid) 1165].