In original AoE all units could “fit” through 1 tile sized wall. But in case of 2 wall tiles on each side, or units blocking the surrounding area the newly created unit would get cancelled.
If you don’t set up a way point then the game mechanics work the same way as they do in AoE (This includes the Not enough room to place a unit. notification). Which means you can build Swordsmen over a wall if you don’t set up a way point.
But with the way points there is no “Not enough room to place a unit.” warning.
The way points also makes it easier to build units through a enemy wall.
By placing the military building right next to an enemy wall and then placing a way point to the other side of the enemy wall you can build your units inside the enemy base.
This bug is present in the old AoE too but it’s almost unusable because it requires you to block the 3 other side of the military building in order to force the units to spawn inside the enemy wall.
With no way points the units would be created to the closest available spot meaning that as long as there is available area alongside the barrack the units will never be created through a wall.
Not allowing units to spawn through enemy walls would be a great solution to this problem but it’s probably a hard feature to code.