Mostly myth. There was a very good post on this by u/NMW that covers it quite well. It's long been a staple of the entertainment world, from the show/film Oh!What a Lovely War, to a soldier being told, "you there, we need a futile gesture..go out and throw yourself on the wire" in Beyond the Fringe, to Rowan Atkinson's Blackadder.
Not to say that Alan Clark's The Donkeys isn't a fun read. It's a hack job, not meticulous, overwrought..but still fun. Clark was able to gleefully highlight some "Colonel Blimp" types, like Sir John French, and point out a lot of errors. And there were indeed errors: especially early on, when everyone was adapting to a very new kind of war, where spirited charges didn't work anymore and Western armies had to fight other Western armies, not just put down colonial rebellions.
But really, at least some of the "donkeys" were learning and trying new things during the course of the war. And their success at the end was due to that: like learning how to not only advance behind shellfire, but how to supply troops once they'd taken an enemy position, so it could be held from a counter-attack. In the end, they would learn that winning was going to be very costly, and they indeed spent those lives to win- but then, that's the job they were given to do. The "donkeys" were never allowed to decide whether they themselves could declare defeat and go home.