The Messenger of Allah ﷺ said, "May Allah have mercy on Lot. He was indeed seeking refuge in a mighty support. Had I remained in prison as long as Yusuf remained, I would have answered the one who summoned me. And we have more cause for doubt than Ibrahim, when Allah said to him, 'Do you not believe?' He said, 'Yes, but only that my heart may be at ease'" [Baqarah 2:260].
قال رسول الله ﷺ: يرحم الله لوطا، لقد كان يأوي إلى ركن شديد، ولو لبثت في السجن ما لبث يوسف لأجبت الداعي ونحن أحق من إبراهيم، إذ قال له: {أولم تؤمن قال بلى ولكن ليطمئن قلبى} [سورة البقرة: ٢٦٠].
Bukhari narrated it in the Tafsir (4694), and Muslim in the Iman (151), both of them through Yunus bin Yazid, from Ibn Shihab, from Saeed bin Musayab and Abu Salama bin Abdul-Rahman, from Abu Hurairah, who said, so he related it. The wording given is Bukhari's, and Muslim's wording is similar.His saying, "I would have responded to the caller," means the caller of the king to come out of prison.