Military analysts often make mistakes.
The conclusion from the Boer war against trained riflemen was not that mass charges are stupid.
The conclusion was mass charges work, if only you throw enough men in.
In WWI, that theory cost millions of lives.
Given the state of technology, there was no other way of waging war against a peer opponent. No radios: so after the preliminary artillery bombardment, usually not nearly as effective as presumed, infantry going over the top had to advance against rifles and machine guns with no fire support.