Anas bin Malik reported,

The Messenger of Allah ﷺ said, "Two men will be brought out of the Fire and presented before Allah. Then the order will be given to return them to the Fire. One of them will turn back and say, 'My Lord, this was not what I hoped for.'Allah will ask, 'What was your hope?'He will reply, 'My hope was that, having taken me out of it, You would not send me back into it.'So Allah will have mercy on him and admit him into Paradise."

Azami 153

Sahih

عن أنس بن مالك قال

قال رسول الله ﷺ: يخرج رجلان من النار، فيعرضان على الله، ثم يؤمر بهما إلى النار، فيلتفت أحدهما فيقول: يا رب ما كان هذا رجائي قال وما كان رجاؤك؟ قال: كان رجائي إذ أخرجتني منها أن لا تعيدني، فيرحمه الله فيدخله الجنة.

الأعظمي 153صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Faith
Chapter
Qualities of faith
Section
Good opinion of Allah coupled with fear and hope
Numbering
Jami al-Kamil 153 (2nd edition)
Azami 153