One way to look at it is that repeated bouts of restriction caused the weight gain and the continuing struggle. More restriction will lead to an even slower metabolism, less spontaneous movement, worse workouts, poor sleep, stronger urges to overeat, and even more weight gain. More restriction doesn't solve anything. It only makes the current struggle worse.
Eating clean, counting calories, following meal plans, and fearing various foods pushed my weight to it's highest point. I remember thinking that I couldn't diet anymore and I couldn't gain anymore so WTF? But when I gave myself more freedom with my eating and paid more attention to hunger and fullness, I gradually lost 20 pounds that have stayed gone for years. I'm quite convinced that if I'd kept restricting and rebounding, I'd be at an all-time high weight right now. Restriction never resulted in permanent weight loss, or even weight loss that was sustainable beyond a few weeks. I'd always gain it back plus some, and then have to restrict more for worse results.