Think about how we describe contraceptives, medically speaking: a failure rate is tracked and promoted that’s the in the wild rate of failure, not the ideal-use rate of failure (which can be effectively zero!). The diet and exercise equivalent of a contraceptive couldn’t be sold, because its failure rate would be way higher than its success rate.
So “we” (people who’ve paid attention to the science on it) know it doesn’t work (on a population level), like for-sure definitely does not work, but a person reads this assertion of fact and goes “but wait it worked for me, this person must be dumb or something” but that’s not it. It’s two different perspectives on what it means for it to “work”.
Last I checked, researchers in the specific area of high-touch weight interventions were excited that they finally had a tool that might more-than-barely work… in glp-1 agonists.
Informing people that they can avoid pregnancy and STDs if they’d just stop fucking each other doesn’t work at scale either.
However, all the evidence is that the vast majority of people fail at changing their habits in ways that produce lasting weight loss, so it does not generally work as advice for reducing your weight.
So you're technically right, but it is irrelevant, because we don't know how to actually get people to change habits with any meaningful rate of success.
At this point it is downright harmful and wildly unethical to recommend it when we now have a far more successful option.