Abdullah bin Abbas reported,

When the Messenger of Allah ﷺ was on his deathbed, there were Some men in the house. The Prophet ﷺ said, "Come, let me write for you a document so that you will never go astray after it."Some of them said, "The Messenger of Allah ﷺ is overcome by pain, and you have the Quran. The Book of Allah is enough for us."The people in the house disagreed and quarreled. Some said, "Bring him what he needs so he may write for you a document after which you will never go astray," while others said the opposite. When their idle talk and disagreement grew loud, the Messenger of Allah ﷺ said, "Get up and leave."Ubaydullah said that Ibn Abbas used to say, "The real calamity, the calamity of all calamities, was what came between the Messenger of Allah ﷺ and his writing that document for them, because of their disagreement and clamor."

Bukhari 4432

Sahih

حدثنا علي بن عبد الله حدثنا عبد الرزاق أخبرنا معمر عن الزهري عن عبيد الله بن عبد الله بن عتبة

عن ابن عباس رضي الله عنهما قال

لما حضر رسول الله ﷺ وفي البيت رجال فقال النبي ﷺ هلموا أكتب لكم كتابا لا تضلوا بعده فقال بعضهم إن رسول الله ﷺ قد غلبه الوجع وعندكم القرآن حسبنا كتاب الله فاختلف أهل البيت واختصموا فمنهم من يقول قربوا يكتب لكم كتابا لا تضلوا بعده ومنهم من يقول غير ذلك فلما أكثروا اللغو والاختلاف قال رسول الله ﷺ قوموا قال عبيد الله فكان يقول ابن عباس إن الرزية كل الرزية ما حال بين رسول الله ﷺ وبين أن يكتب لهم ذلك الكتاب لاختلافهم ولغطهم

البخاري 4432صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Expeditions
Chapter
Illness of the Prophet ﷺ and his death
Numbering
Darussalam 4432
Bukhari 4432