When the surah "Lam yakun" was revealed, Jibril said, "Muhammad, your Lord commands you to recite this surah to Ubayy bin Kaab."So the Prophet ﷺ said, "Ubayy, my Lord
has commanded me to recite this surah to you."Ubayy wept and asked, "Was I mentioned there?"He replied, "Yes."
حدثنا أبو سعيد مولى بني هاشم قال حدثنا حماد بن سلمة عن علي بن زيد عن عمار بن أبي عمار
لما نزلت لم يكن قال جبريل عليه السلام يا محمد إن ربك يأمرك أن تقرئ هذه السورة أبي بن كعب فقال النبي ﷺ يا أبي إن ربي عز وجل أمرني أن أقرئك هذه السورة فبكى وقال ذكرت ثمة قال نعم
Its isnad is hasan because of Ali bin Zayd bin Jadan. The hadith is found in Bukhari 7/127, no. 3809 (Fath), in the Book of Virtues, chapter on the virtues of Ubayy bin Kaab, and in Muslim 1/550, no. 799, in the Book of Travelers, chapter on the recommendation of reciting the Quran, and in Tirmidhi similarly to Bukhari, 5/711, no. 3898, where he graded it hasan.