Abdullah bin Abbas reported,

When the Prophet's ﷺ illness grew severe, he said, "Bring me writing materials so I may write for you a document after which you will never go astray."Umar said, "The pain has overcome the Prophet ﷺ. We have the Book of Allah, which is sufficient for us."The people then disagreed and the clamor grew loud, so he said, "Leave me. It is not fitting that you quarrel in my presence."Ibn Abbas went out saying, "The real calamity, the greatest calamity, was what came between the Messenger of Allah ﷺ and his writing of that document."

Bukhari 114

Sahih

حدثنا يحيى بن سليمان قال حدثني ابن وهب قال أخبرني يونس عن ابن شهاب عن عبيد الله بن عبد الله

عن ابن عباس قال

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

البخاري 114صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Knowledge
Chapter
Writing down knowledge
Numbering
Darussalam 114
Bukhari 114