Yeah, it's gotta seem like a very weird thing to say if you haven't been through it, but your mind isn't the single entity you think it is. There are different components each with different motivations, purposes, responsibilities, etc. And a few of them really don't like what you're doing. They have access to the same reasoning engine as the parts that want to lose weight so they can make convincing arguments. Fighting them off wears down your will until they eventually win if you aren't careful.
And that isn't counting the effects of other parts of your body like your gut microbiome.
And that isn't counting the effects of other parts of your body like your gut microbiome.