Abdullah bin Abbas reported,

When the Messenger of Allah ﷺ was nearing death, there were some men in the house. The Prophet ﷺ said, "Come, let me write for you a document after which you will never go astray."Some of them said, "The Messenger of Allah ﷺ is overcome by pain, and you have the Quran. The Book of Allah is sufficient for us."The people in the house disagreed and began to argue. Some said, "Bring something so he can write for you a document after which you will never go astray." Others said otherwise.When their idle talk and disagreement grew excessive, the Messenger of Allah ﷺ said, "Get up and leave."Ubaydullah said that Ibn Abbas used to say, "The real calamity, the greatest calamity, was what came between the Messenger of Allah ﷺ and his writing that document for them, because of their disagreement and clamor."

Azami 6114

Sahih

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

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

الأعظمي 6114صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Bequests and endowments
Section
Bequest of the Messenger of Allah ﷺ regarding the public interest
Numbering
Jami al-Kamil 6114 (2nd edition)
Azami 6114