My thoughts: If one's math does not account for Stunning Strike, building analysis on top of that math is building a castle in a swamp. It's the monk's signature ability. Ignoring it is like doing analysis on a warlock and ignoring Agonizing Blast.
It's weird that Treantmonk of all people makes this mistake. Back in 3E, he was the guy who popularized the insight that a wizard's most effective spells are not blasting but debuff and control. Apparently he's forgotten his own lessons.
The baseline DPR also ignores the fact that a warlock can do things that aren't EB+AB. They have spell slots on top of that, and invocations, and eventually level 6-9 spells.
If the monk could do nothing but baseline DPR, it would be even worse off.
Stunning Strike is something that they can do on top of baseline DPR, as is flurry, as are their other abilities.
At 0.6 hits/swing and 3 swings/round (no flurry), they get to use 1.8 Ki to stunning strike. Assuming foes with con save proficiency and roughly similar CR and con that is +2-4 points higher than Monk Wisdom, the monster needs a 6-7 to save against the stunning strike; call it a 7+ for a 70% save chance.
1.8 attempts/round means roughly a 50% chance to land a stun each round, or 0.6 legendary resists defeated at a cost of 1.8 Ki (here you can't). ( If merely trying to stun you save a small amount by not stunning already stunned foes)
To eat through 3 legendary resists, this takes 5 rounds or so and 10 Ki on average.
If you flurry, you go up to 2.4 attempts/round at a cost of 1.42 Ki/attempt. This drops the time to strip 3 legendary resists down to 4.2 rounds and ups the cost to 14.2 Ki on average.
(On foes with a lower save chance, this is both faster and more efficient.)
A spellcaster with a spellcasting stat that exceeds enemy con by 2 (and after cap gets +DC gear), and casting a "save or suck" spell each round strips 0.4 legendary resists/round, taking 7.5 rounds to strip all 3 legendary resists at the cost of 7.5 save-or-suck spells. The monk is more than twice as good as the spellcaster at this task (they are 33% faster and use short rest resources instead of long rest resources; even warlocks need to use long rest resources to strip one foe of their legendary resists).
Even then, only heavy spellcaster parties can afford to do this kind of focusing on legendary resists. Round 4 or round 5 is mostly after the fight is over, so a monk can't reliably land a stun on a foe before focus fire would defeat it. Spellcasters who go for save-or-suck spells don't contribute much damage while doing so, so (in practice) you have to give up on dropping them in order to land such spells.
Also, on lesser foes, monk stun is not as good as most kinds of spell based area control. One spell can lock down a dozen foes, or kill that dozen with a fireball.
I suspect in the intermediate case, of monsters that are both tough and numerous, not so tough they ignore the monk stun, not so numerous that an AOE hitting 12 targets is far more efficient, the monk stunning fist matters more. Also, in games where damage optimization isn't occur much, legendary monsters
stay around for longer, giving more time to strip out their legendary resists.