The Messenger of Allah ﷺ said, "There are three whom Allah will not speak to on the Day of Resurrection, nor look at, nor purify, and they will have a painful punishment. A man who withholds surplus water from a traveler, a man who swears a false oath over merchandise after the afternoon prayer, and a man who pledges allegiance to a leader, fulfilling his pledge if the leader gives him something but breaking it if the leader does not."
حدثنا وكيع عن الأعمش عن أبي صالح
قال رسول الله ﷺ ثلاثة لا يكلمهم الله يوم القيامة ولا ينظر إليهم ولا يزكيهم ولهم عذاب أليم رجل منع ابن السبيل فضل ماء عنده ورجل حلف على سلعة بعد العصر يعني كاذبة ورجل بايع إماما فإن أعطاه وفى له وإن لم يعطه لم يوف له
Its chain of transmission is sahih. Muslim narrated it in the Book of Faith, "Three whom Allah will not speak to." Abu Dawud narrated it in the Book of Sales, in the chapter on withholding water. Tirmidhi narrated it in the Book of Military Expeditions, in the chapter on breaking a pledge of allegiance, and the wording given here is his. This hadith has also passed in many other places.