Yehoshua, Eldad and Meidad
Upset that Eldad and Meidad prophesied before Moshe Rabbeinu, Yehoshua tells Moshe to imprison them, ruling in his rebbe’s presence, and is punished.
A Gemara in Eiruvin 63a says that Yehoshua died without children. The Gemara says that this was a punishment for disparaging his rebbe, Moshe Rabbeinu, by deciding a halachah in his presence:
The Torah tells us that Hashem gave the gift of prophecy to Eldad and Meidad among other z’keinim. Whereas the other new prophets of that time kept their prophecies to themselves, Eldad and Meidad shared theirs publicly. The midrash explains that the prophecy dealt with Moshe Rabbeinu’s death. Yehoshua felt that the public recital of this prophecy was disparaging to his beloved mentor. Further, Rashi in Eiruvin explains that Yehoshua felt that Eldad and Meidad deserved the death penalty. Stating any prophecy in front of one’s rebbe is tantamount to rendering halachic decisions in his rebbe’s presence and warrants the death penalty.