Torah Temimah on this passuk (citation pointer only). Core text is Chazal as recorded — consequence of speaking before one’s teacher (related derasha).
English: Whoever replies a word before his teacher…
Category D — Conceptual / logical / legal / theological / ethical inference.
Method: The related derashah treats Yehoshua’s words as an example of speaking before one’s teacher, deriving an ethical rule of deference from the exchange.
Textual trigger: Yehoshua’s address “אֲדֹנִי מֹשֶׁה כְּלָאֵם” (Bamidbar 11:28), in the teacher-student setting.
The midrash ties the episode to the discipline of speech before one’s master.