@Erogami:
Also in a real battle the enymy could have placed traps and lure you into them.
For example make a giant pitfall and cover it with a wooden board that can carry real people and maybe even carriages.
Then put some dirt on it to cover it.
As long as only people or a carriage pass over it there won't be any issues.
But once a heavy giant metal thing like those "knights" step on it the wooden board will break and the knight with the pilot will fall into the pit.
Furthermore in a real battle there is no guarantee that the enemy fights one-vs-one.
In a real battle it would be likely to be attacked from another enemy while you are blocked by the one in front of you.
War is not "many times 1-vs-1" but "one time many-vs-many".
Therefore keeping your distance and shooting is actually more beneficial cause it allows many combatants from one side to focus their attacks on a single target and to support each other from a distance.
Compared to that close quarter combat heavily restricts your allies from attacking the same target and only allows those allies close to you to support / aid you.
----
But then again why do we even bother about the "idiocy" of those side characters.
After all we know very well that they would not be that way in reality because them being stupid in the manga / novel / whatever story is just the author making them dumb so that the MC seems smart, powerful or/and exceptionally talented compared to the side characters.
If such a world would be reality then fighting in a way that allows you to minimize the damage you take would be normal cause any damage taken could lead to your ultimate death.
Hence in a real world they would focus on ranged attacks if they can do it and only use close quarter combat if they have no other choice.