The truth of “YHWH says” in Joshua is not in YHWH’s actual will and statements but in Joshua’s victory. For the author of Joshua to say “YHWH says” means that Joshua won. How could Joshua have won without YHWH saying so? To the author it would be unthinkable and impossible for Joshua to have won Canaan without the approval of God. (A similar thing could be said about the Babylonian exile. That is one reason why it was so hard for Jews. How could God elect and approve of the demise of his own chosen people?)
So then, did YHWH actually want Joshua to take over Canaan? It depends on how you look at it. From one perspective (the perspective of Joshua’s author, in my humble opinion), YHWH did want Joshua to take over Canaan because Joshua did take over Canaan. From another perspective, God did not want Joshua to conquer Canaan, “for he does not afflict from his heart or grieve the children of men” (Lam. 3:33). So it depends on how you look at it.
It is easier for me to square away Joshua with Jesus by reinterpreting Joshua, rather than accepting the story at face value.