Abdullah bin Abbas reported,

When the Prophet ﷺ was on the verge of death, Some men were in the house, among them Umar bin Khattab. The Prophet ﷺ said, "Come, let me write for you a document after which you will never go astray."Umar said, "The Prophet ﷺ is overcome by pain, and you have the Quran with you. The Book of Allah is sufficient for us."The people in the house disagreed and quarreled. Some of them said, "Bring writing materials so that the Messenger of Allah ﷺ may write for you a document after which you will never go astray." Others repeated what Umar had said.When their clamor and disagreement grew loud in the presence of the Prophet ﷺ, he said, "Get up and leave me."Ubaydullah reported that Ibn Abbas used to say, "The calamity, the great calamity, was what stood between the Messenger of Allah ﷺ and his writing that document for them, namely their disagreement and clamor."

Bukhari 7366

Sahih

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

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

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

البخاري 7366صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Adhering to the Book and the Sunnah
Chapter
Dislike of disagreement
Numbering
Darussalam 7366
Bukhari 7366