Saadam Hussein built gigantic sand berms and thick minefields to impede the 5th and 7th corps in 1991 and it was just a speed bump. He could have built a 20'tall 15 thick stone wall and would have hardly made a difference.
The fact that the Great Wall was a known obstacle that existed for a long time would have given any potential attacker plenty of time to study the problem and figure out a solution.
Gunpowder and explosives ended the reign of stone walls.
The Germans outflanked the Magiont Line, the Egyptians figured out how to breach the Bar Lev line in 73 and quickly move large formations of armored and infantry through it as did the Western forces in 1991 in Kuwait when faced with a long wall. Stone walls or not. Once breached attackers will just use tanks with bulldozer blades to clear paths through which follow up forces will pass through rapidly.
This is way off topic & I'm sorry I even brought the matter up.
The difference between sand and stone should be fairly obvious; Coalition forces flanked around the more heavily defended obstacles for the most part (as Hussein didn't anticipate large armored columns being able to navigate the desert), and in spots where we did opt to breach, the Iraqi defenders put up little or no effort to make it difficult. You pointed out yourself that the Germans outflanked the Maginot line, and a huge part of the Egyptian's success at the Suez involved an overconfident & outmanned Israeli defensive force and the innovate use of high-pressure water cannons to crumble the mostly earthen walls. Point being that none of the tactics used in those examples would work in the case of a huge stone wall completely surrounding a nation's land borders (you could of course stage an amphibious landing).
The plain and simple fact of the matter is that large, armored vehicles do not like rubble. You can't really drive over it, and attempting to navigate through/around it against a determined enemy will result in much slower progress and a much higher casualty rate; this has been the issue with urban warfare since WWII and remains so to this day. I'm not saying a few archers could stop a tank column, wall or no wall, but I am saying that the tank column would
have to stop while engineers demolished and then cleared said wall. Sand berms disintegrate when faced with large amounts of high explosives--solid stone walls do not.
FWIW, I did spend a bit of time driving an APC a few years back. I used to think that concertina wire was the stupidest obstacle ever, until I saw what happened when a bunch of it gets wrapped around the axle of a HMMWV.
Okay, back to discussing Civ. I'll gladly carry this on via private message if anyone really wants to.