Even Joshua had lost the divine perspective temporarily. His complaining lament sounds like Israel"s murmuring in the wilderness (cf. Exodus 16:3; Numbers 14:2-3; et al.). However, he also had a concern for the continuing honor of Yahweh ( Joshua 7:9; cf. Exodus 32:11-12; Numbers 14:13; Deuteronomy 9:28). As Moses, Joshua desired above everything that God would receive glory. Unfortunately he did not yet possess the stability and objectivity that characterized Moses" later years because he had not yet walked with God as closely or as long as Moses had. [source][source][source]
"Joshua had fallen on his face once before, when he confronted the divine messenger ( Joshua 5:14). That was in the humility of worship. This is in the humility of defeat and shame." [1][source]