(83) بَابُ مَرَضِ النَّبِيِّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ وَوَفَاتِهِ
Narrated Ubaidullah bin `Abdullah:
Ibn `Abbas said, "When Allah's Messenger (ﷺ) was on his deathbed and there were some men in the house, he said, 'Come near, I will write for you something after which you will not go astray.' Some of them ( i.e. his companions) said, 'Allah's Messenger (ﷺ) is seriously ill and you have the (Holy) Qur'an. Allah's Book is sufficient for us.' So the people in the house differed and started disputing. Some of them said, 'Give him writing material so that he may write for you something after which you will not go astray.' while the others said the other way round. So when their talk and differences increased, Allah's Apostle said, "Get up." Ibn `Abbas used to say, "No doubt, it was very unfortunate (a great disaster) that Allah's Messenger (ﷺ) was prevented from writing for them that writing because of their differences and noise."
Reference: Sahih al-Bukhari 4432
In-book reference: Book 64, Hadith 454
USC-MSA web (English) reference(deprecated numbering scheme): Vol. 5, Book 59, Hadith 717