The Messenger of Allah ﷺ said, "A man may ask me for something and I withhold it from him so that you may intercede on his behalf and be rewarded for it." The Messenger of Allah ﷺ also said, "Intercede, and you will be rewarded."
أخبرنا هارون بن سعيد قال أنبأنا سفيان عن عمرو عن ابن منبه عن أخيه
أن رسول الله ﷺ قال إن الرجل ليسألني الشيء فأمنعه حتى تشفعوا فيه فتؤجروا وإن رسول الله ﷺ قال اشفعوا تؤجروا
No references are available.
Sourcing, [sahih] Abu Dawud narrated it in the Book of Manners, chapter on intercession, no. 5132, from the hadith of Sufyan bin Uyayna, with this chain, and it is also in al-Kubra, no. 2338. Amr is Ibn Dinar, and his teacher is Wahb.