Hajjaj said in his version of the hadith, I heard Abu Hurayrah say, the Messenger of Allah ﷺ said, or he said Abu Qasim said, "While a man was walking along wearing a fine garment, his hair combed and flowing, admiring himself, the earth suddenly swallowed him up, and he will keep sinking through it until the Day of Resurrection."Hajjaj's version says, "Allah caused the earth to swallow him."
حدثنا محمد بن جعفر وحجاج قالا حدثنا شعبة عن محمد بن زياد
عن النبي ﷺ قال حجاج في حديثه قال سمعت أبا هريرة قال قال رسول الله ﷺ أو قال أبو القاسم أنه قال بينما رجل يمشي وعليه حلة مرجلا جمته تعجبه نفسه إذ خسف به فهو يتجلجل في الأرض إلى يوم القيامة وقال حجاج إذ خسف الله به
Its chain of transmission is sahih. It was also mentioned before, and it appears in Bukhari 7/183, in the Book of Clothing, in the chapter on one who drags his garment out of arrogance, and in Muslim 3/1653, number 2088, with similar wording.