The Messenger of Allah ﷺ said, "No one leaves Madinah out of dislike for it without Allah replacing him with someone better."
أن رسول الله ﷺ قال: لا يخرج أحد من المدينة رغبة عنها إلا أبدلها الله خيرا منها.
Malik related it in the Muwatta, in the narration of Maen bin Isa, from Hisham bin Urwa, from his father, from Ayesha, as Jawhari stated in Musnad Muwatta, and Ibn Abdul-Barr in al-Istidhkar (6/112), and its isnad is sahih. As for the narration of Yahya Laythi, it is mursal, without mentioning "Ayesha."