Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:21:86

And We admitted them into Our mercy. Indeed, they were of the righteous.  

And We admitted them into Our mercy, through ˹granting them˺ prophethood. Indeed they were among the worthy, of it. Dhū’l-Kifl was so called because he undertook (takaffala) to fast every day and stay up every night in prayer, and to pass judgement between people without succumbing to anger, and fulfilled this ˹undertaking˺. It is also said, however, that he was not a prophet.
القرآن:٢١:٨٦

وَأَدْخَلْنَاهُمْ فِي رَحْمَتِنَا ۖ إِنَّهُمْ مِنَ الصَّالِحِينَ  

{وأدخلناهم في رحمتنا} من النبوة {إنهم من الصالحين} لها وسمي ذا الكفل لأنه تكفل بصيام جميع نهاره وقيام جميع ليله وأن يقضي بين الناس ولا يغضب فوفى بذلك وقيل لم يكن نبيا.

See similar narrations below:

Collected by Qurʾān
quran:21:75

And We admitted him into Our mercy. Indeed, he was of the righteous.  

And We admitted him into Our mercy, by Our saving him from his people. He was indeed one of the righteous.
القرآن:٢١:٧٥

وَأَدْخَلْنَاهُ فِي رَحْمَتِنَا ۖ إِنَّهُ مِنَ الصَّالِحِينَ  

{وأدخلناه في رحمتنا} بأن أنجيناه من قومه {إنه من الصالحين}.