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 overwhelmed the Prophet ﷺ. We have the Book of Allah, which is sufficient for us."The people then disagreed and the clamor grew loud, so the Prophet ﷺ said, "Leave me. It is not fitting that there be dispute in my presence."Ibn Abbas went out saying, "The true calamity, the greatest calamity, is what came between the Messenger of Allah ﷺ and his writing of that document."

Azami 1167

Sahih

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

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

الأعظمي 1167صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Knowledge
Chapter
Encouragement to seek knowledge
Section
Recording of knowledge
Numbering
Jami al-Kamil 1167 (2nd edition)
Azami 1167