I’m looking at Bemidbar 31:3. The Midrash Tanchuma Mattos 4 says Yehoshua was slated to live 120 years like Moshe. Why did Yehoshua think he would die immediately after conquering the kings of Canaan? He wanted to live longer so delayed. Therefore G-d shortened his life by 10 years. Tetzavaeh 9 says he lost 10 years as he spoke in the presence of Moshe (Bemidbar 11:28). Why would Yehoshua try to outsmart G-d?
See Shaarey Aaron & Pardes Yosef.