وَالَّذِي نَفْسِي بِيَدِهِ لَا تَذْهَبُ الدُّنْيَا حَتَّى يَمُرَّ الرَّجُلُ عَلَى الْقَبْرِ فَيَتَمَرَّغَ عَلَيْهِ، وَيَقُولَ: يَا لَيْتَنِي كُنْتُ مَكَانَ صَاحِبِ هَذَا الْقَبْرِ، وَلَيْسَ بِهِ الدِّينُ إِلَّا الْبَلَاءُ
Translation: By Him in whose hand is my soul, the world will not end before a man passes a grave, rolls upon it, and says, “If only I were in the place of the one buried here.” He will be driven to this not by a religious aspiration but by severe affliction.
Source: مسلم
الْقَبْرِ is a grave; فَيَتَمَرَّغَ describes rolling upon it in distress; يَا لَيْتَنِي introduces an anguished wish (“If only I…”); and الْبَلَاءُ is severe trial or affliction.
The report describes distress so intense that a person wishes to be in the grave. It describes a condition; it does not recommend wishing for death.