Urwa reported,

He asked Ayesha رضي الله عنها, the wife of the Prophet ﷺ, "Tell me about His words, 'until, when the messengers despaired and thought that they had been denied' [Yusuf 12:110], is it kudhdhibu or kudhibu?"Ayesha replied, "It is kudhdhibu, meaning their people denied them."He said, "But by Allah, they knew for certain that their people had denied them. This was no mere supposition."She said, "Urayyah, they certainly knew that for certain."He said, "Then perhaps it is kudhibu?"She replied, "Allah forbid. The messengers would never think such a thing of their Lord. As for this verse, it refers to the followers of the messengers, those who believed in their Lord and accepted them as truthful. The trial dragged on for them and victory was delayed, until the messengers despaired of those among their people who had denied them, and they supposed that even their own followers had come to disbelieve them. At that point the help of Allah came to them."Abu Abdullah said, "Istayasu is the istafala form derived from yaistu, meaning I despaired. In the phrase 'minhu' the reference is to Yusuf. And 'do not despair of the mercy of Allah' [Yusuf 12:87] carries the sense of hope."

Bukhari 3389

Sahih

حدثنا يحيى بن بكير حدثنا الليث عن عقيل عن ابن شهاب قال

أخبرني عروة

أنه سأل عائشة رضي الله عنها زوج النبي ﷺ أرأيت قوله {حتى إذا استيأس الرسل وظنوا أنهم قد كذبوا} أو {كذبوا} قالت بل كذبهم قومهم فقلت والله لقد استيقنوا أن قومهم كذبوهم وما هو بالظن فقالت يا عرية لقد استيقنوا بذلك قلت فلعلها أو {كذبوا} قالت معاذ الله لم تكن الرسل تظن ذلك بربها وأما هذه الآية قالت هم أتباع الرسل الذين آمنوا بربهم وصدقوهم وطال عليهم البلاء واستأخر عنهم النصر حتى إذا استيأست ممن كذبهم من قومهم وظنوا أن أتباعهم كذبوهم جاءهم نصر الله قال أبو عبد الله {استيأسوا} استفعلوا من يئست {منه} من يوسف {لا تيأسوا من روح الله} معناه الرجاء

البخاري 3389صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Hadiths of the prophets
Chapter
Saying of Allah Most High, "Verily in Yusuf and his brothers were signs for those who ask"
Numbering
Darussalam 3389
Bukhari 3389