MG-42 fires at 1,200 rpm. If machine guns were the death of open terrain warfare then why did all the German generals cry in their memoirs about human wave attacks on the eastern front? Why not trench up and own the ruskies if this is the case?
The confederates fired the largest artillery barrage of the war before Pickett's charge. Shouldn't that have devastated the Union trenches?
If direct fire weapons are so deadly to open terrain combat then why the move to tanks? They too are countered quite easily by direct fire weapons.
If trenches exist solely to counter direct fire then we would expect WWII to have been a war of tunneling machines, not mobile armor.
Pop-history wants to talk about whats sexy and new because they want to sell books. They don't want to talk about what's actually effective i.e. incremental advances in artillery size and density.
At Waterloo there was one artillery piece for every 477 men. Most were around the 6 pound range. (https://en.wikipedia.org/wiki/Order_of_battle_of_the_Waterloo_campaign)
At Gettysburg there were similar numbers at one piece per 578 men, however most guns were around the 12 pound range. (https://www.teachersfirst.com/gettysburg/weapons.cfm)
In WWI a standard british infantry division had one piece per 236 men. 18 pound guns were the most common. (http://militaryhistoryvisualized.com/british-infantry-division-19141916-visualization-organization-structure/)
In 1944 the standard German infantry division had 76 mortars and 48 guns for 12,000 men. A ratio of an artillery piece per 96 men. (https://www.ww2-weapons.com/germany-army-unit-organisation-1942-45/)
I'm not certain if you realise, but machine-guns and other small arms are not effective against armoured vehicles, but they are against men. This is why there was a move to try and develop Tanks. ATGs were not a feature of The Great War, the best developments in this area were a repurposing of field guns, late in the conflict.
In WWII tanks were most effectively used for manoeuvre warfare, as they are able to more easily circumvent defensive positions and strike weakpoints, while also carrying heavy armament and being resistant to infantry attack. This is the basis of Blitzkrieg.
On the other hand, Artillery is rather effective against armoured vehicles. This doesn't quite support your theory.
Further, in WWII there was a distinct move away from static battle lines. This was, in part, due to further improvements in artillery technology. Static trenches are not the preferable defence against indirect fire weapons.
As an aside, The Great War did in fact see the use of fairly large-scale tunneling efforts to attempt to circumvent No-Mans-Land. If "Tunneling machines" had been a viable device, then they absolutely would have been used during the war.