Rabbi Judah said in the name of Rav: Whoever is arrogant — if he is a prophet, his prophecy departs from him; if he is a sage, his wisdom departs from him. That if he is a sage his wisdom departs — from where do we know it? From Hillel. For the master said: He began to provoke them with words. He said to them, "What caused you that I should come up from Babylon and become prince over you? The laziness that was in you, that you did not serve the two great ones of the generation, Shemaiah and Avtalyon." And then he said to them, "This law I heard and forgot" [his own wisdom failed him at the moment of his pride]. That if he is a prophet his prophecy departs — from where do we know it? From Deborah, as it is said, "The unwalled towns ceased... until I, Deborah, arose" (Judges 5:7), and it is written, "Awake, awake, Deborah" (Judges 5:12) [the prophetic spirit had to be roused back to her after she boasted].
Arrogance Drives Prophecy From the Prophet and Wisdom From the Sage
Yalkut Shimoni on Nach 49:2
א"ר יהודה אמר רב כל המתיהר אם נביא הוא נבואתו מסתלקת אם חכם הוא חכמתו מסתלקת. אם חכם הוא וכו' מגלן מהלל דאמר מר התחיל מקנתרן בדברים וקאמר להם מי גרם לכם שאעלה מבבל ואהיה נשיא עליכם עצלות שהיתה בכם שלא שמשתם שני גדולי הדור שמעיה ואבטליון וקאמר להם מי גרם לכם שאעלה מבבל ואהיה נשיא עליכם עצלות שהיתה בכם שלא שמשתם שני גדולי הדור שמעיה ואבטליון וקאמר להו הלכה זו שמעתי ושכחתי. אם נביא הוא נבואתו מסתלקת אם חכם הוא חכמתו מסתלקת. אם חכם הוא וכו' מנלן מהלל דאמר מר התחיל מקנתרן בדברים וקאמר להם מי גרם לכם שאעלה מבבל ואהיה נשיא עליכם עצלות שהיתה בכם שלא שמשתם שני גדולי הדור שמעיה ואבטליון וקאמר להו הלכה זו שמעתי ושכחתי. אם נביא הוא נבואתו מסתלקת מגלן, מדבורה שנאמר חדלו פרזון וגו' עד שקמתי דבורה וכתיב עורי עורי דבורה: