Yes, that's a problem.
Historically people didn't fight like that because the one who didn't get in formation would be wiped out easily by the one who was in formation.
That's what we should try to reproduce - if I'm reading Devereaux's Acoup well, the roman formation had swordsmen stabbing the enemy if they had an opportunity, then retreating to the formation. We could have something like that for some formations I guess...
Also and as I mentioned many times, historically one of the main reason for formations was to keep morale.
So only when we'll have a morale system will we be able to have a good formation system.
Side note : IIRC Devereaux also stated that the modern recreations of shield walls pictured above are not really how a shield wall was done historically.