Sahih Muslim 142 b
Narration text is preserved in its supplied Arabic and English. Translated interfaces and reading guides do not add narration translations in other languages.
لاَ يَسْتَرْعِي اللَّهُ عَبْدًا رَعِيَّةً يَمُوتُ حِينَ يَمُوتُ وَهُوَ غَاشٌّ لَهَا إِلاَّ حَرَّمَ اللَّهُ عَلَيْهِ الْجَنَّةَ "
Hasan reported:
Ubaidullah b. Ziyad went to see Ma'qil b. Yasir and he was ailing. He ('Ubaidullah) inquired (about his health) to which he (Ma'qil) replied: I am narrating to you a hadith which I avoided narrating to you (before). Verily the Messenger of Allah (ﷺ) observed: Allah does not entrust to his bondsman the responsibility of managing the affairs of his subjects and he dies as a dishonest (ruler) but Paradise is forbidden by Allah for such a (ruler). He (Ibn Ziyad) said: Why did you not narrate it to me before this day? He replied: I (in fact) did not narrate it to you as it was not (fit) for me to narrate that to you.
Full reference and source
Sahih Muslim 142 b In-book : Book 1, Hadith 271 USC-MSA web (English) : Book 1, Hadith 262 (deprecated)
View source on Sunnah.com (opens in a new tab)