Have I Done It Wrong All Along?

I joined 8 months ago in order to lose weight.
I watched all the videos, did the work and lost 40 pounds.

Then maintenance period started, though I got no letter in the mail announcing that :-), and so before I knew it I started to make exceptions on vacation, on holidays, on dinners with friends, and gained all the weight back in just two months.

Following the protocol felt easy 95% of the time. I just kept marking calendar days and weighing myself and the loss kept showing up consistently with no problem.

Now I want to resume that protocol that worked so perfectly the first time and I am looking at the calendar to plan how long it will take me to lose these 40 pounds again and suddenly it dawned on me that maybe I was doing it wrong all along.

It did not feel like willpower. It felt easy and I only marked days off of the calendar because I was curious to see how long it takes me to lose the 40 pounds.
I thought, the more I don’t eat flour and sugar, the more my desire for it will disappear.
But the desire is back in full force as if I’ve done no work at all.

I wonder if I perhaps only worked on the Action line without addressing lowering the desire for these foods (flour and sugar) and if I do that differently now, what will it look like?
Aside of eliminating flour and sugar from my food plan and by that interrupting the desire model, how else do I work on eliminating the desire for them?