I've noticed this but not as severely as you are. Occasionally when you tell units to make a formation without then telling them to readjust their location they will not properly move into their position. I have been able to solve this by telling the formation to move to a location, slightly forward or back from the original.
I think the issue is that they path to a spot for the initial called formation, then do not often check their position in relation to the formation then auto readjust, without being told to. This makes it so weird gaps show up in defensive lines that don't fill back in unless something is causing the units to move on their own (ie. responding to enemies, charging, moving positions etc.) I notice it most when i ride through my frontline with my horse and the units do not move back into place