The narrative I've always heard is that in WWI technology had surpassed strategy; the old viewpoint of just charging directly at the enemy didn't work because, well...machine guns. With no unique ideas, it became trench warfare because attacking was futile.
So...didn't they do the exact same thing 25 years later when they stormed the beaches of Normandy?
Just to kind of get this out there, that perception of WWI is incredibly flawed. Here's some further reading that you may be interested in:
The short of it is this: Trench Warfare was adopted for strategic and operational reasons and not tactical reasons. In other words trench warfare began because it was conducive to both sides' war effort to dig in when they did in early 1915. The Germans thought to win in the East as they were experiencing a lot of victory over there and the French/British needed time to regroup. The tactics weren't "run at machine guns directly" and it wasn't born out of "no unique ideas" nor was attacking "futile". The idea was that artillery was so overwhelmingly powerful that artillery alone could batter enemy positions down and the infantry merely occupied what the artillery conquered.
By this time though we still see sophistication of infantry doctrine. By 1915 the French had implemented small unit tactics into their general army. By 1916, at the Brusilov Offensive, the Russians for instance were using deep infiltration tactics that the Germans would use in 1918. By February 1917 the British General Manual for the Attack specified small unit tactics. Even during the Somme most Battalions would use creeping barrages and limited small unit tactics.
There's this idea that attritional based warfare = inherently bad. Like decisive > attrition in all cases no matter what. This takes zero consideration for the fact that attrition based warfare is historically safer for the average soldier than decisive. It would be in the opening months of August and September 1914 where the French would suffer the most average casualties of the entire war, even more than Verdun and they were the most mobile until August 1918. The principle of battering something extremely hard and then sending reinforced waves to overwhelm the position is as old as war itself. The very principle of the Greek Phalanx was that by having more depth you would overwhelm a thinner phalanx. Strength in depth was always the principle. We see that in, for instance, the highly sophisticated Soviet Deep Battle Doctrine which had a very WWI feel to it at its core -- waves of men would bash against the front until breakthrough was achieved.
Suffice to say the "stalemate" you speak of only existed in 1915 and it was not for tactical but strategic reasons. On top of that it only existed in France. That has nothing to say about the experience in, say, Eastern Europe where literally the exact same type of weapons and armies were being used but it didn't grind to a halt. The West stalled because both sides had benefits in stalling. For instance the French plan in 1940 was basically to hold off the Germans in Belgium, wait 2 years for the British to come up fully, and then crash into the Germans hard in 1942 with a combined offensive. Ceasing operations (at least on a major decisive scale) is not bad inherently. By 1916 decisive victories would be won and by 1917 static trench warfare did not exist in the West any longer.
So while I can't argue in depth about Normandy as it's a bit outside my wheelhouse I can warn you this: Try to reevaluate how you look at this scenario in the first place. The principle of it is not flawed. Outside of Omaha there was smashing success against equally or near equally fortified regions. We see from Omaha to the Somme that the issue isn't the tactic itself but the delegation of ordinance. We look at the Southern bits on July 1st 1916 and we see massive and overwhelming success because the French had significantly more and better heavy guns to support the bombardment and attack. The more North we got the more it relied on the far fewer and worse British heavy guns and thus the attack stunted more. Similarly the worse beaches in Normandy, notably Omaha, were such not because "charging into machine guns" but because the strategic bombardment did not do a sufficient job.
I think you have some problem with terms. Attacking the French Coast was Strategy, how exactly this was done is operations and tactics. If you read the diary of Alan Brooke (chief strategist of the British) he never rights anything about how exactly the defences against the Beaches should be taken.
Also, that they just 'stormed the beaches' is incorrect. The Operation consisted of a combination of paratroopers, bombing of communication (railways, roads ...), naval bombardment, mine clearing and much more.
To even get to a point were they thought they could invade France they first attacked in Italy to pull down troupes there and force the Germans to replace all the lost Italian troupes.
To do some these tasks, special vehicles were invented. See:
The normal Swimming Tanks were also used.
So I think you are underestimating the amount of thought that went into Operation Overlord. It was a important point in a multiyear strategic concept for winning the war. It was prepared and planned for extensively.
In War its often the case that in the End, Infantry has to take the position. A good military will try to put the infantry in a good position to succeed, but in the end you can not avoid it completely (not in WW2 at least).
Looking at the loses:
They are pretty small considering these troupes were frontal attacking on heavy defended positions.