The Prophet ﷺ entered one of the gardens of Banu Najjar and heard a sound coming from a grave. He asked about it, "When was this person buried?"They replied, "Messenger of Allah, this one was buried during the days of ignorance."This pleased him, and he said, "Were it not that you would cease burying your dead, I would have asked Allah to make you hear the punishment of the grave."
حدثنا ابن أبي عدي عن حميد
دخل النبي ﷺ حائطا من حيطان بني النجار فسمع صوتا من قبر فسأل عنه متى دفن هذا فقالوا يا رسول الله دفن هذا في الجاهلية فأعجبه ذلك وقال لولا أن لا تدافنوا لدعوت الله عز وجل أن يسمعكم عذاب القبر
Its chain of transmission is sahih. The hadith was narrated by Muslim (4/2200, no. 2868), in the chapter on Paradise, the presentation of the deceased's resting place, and by Nasai (4/102, no. 2058), in the chapter on funerals, the punishment of the grave, and by Ibn Hibban (199, no. 785, Mawarid), from Abu Saeed.