Why am I gaining weight?

I am having a lot of trouble understanding why my weight is going up. I look at the number and I think “what but I stuck to the plan yesterday?” “I was so hungry all day” “Why is this happening I’m doing everything right”.

I had committed to a protocol 3 days ago for 2 weeks (eating within an 8 hour window). This worked well in the past, and I’d gradually shortened the eating window. I didn’t feel like I had eaten much yesterday and feel like the weight this morning is un-understandable. It might be that tomorrow I’ll see the results of the sticking to the plan.

I thinking that all I need to do is stick to my eating window and not freak out now even though I’m feeling a bit tired and dispirited and hungry. But I can see in a few days, if the weight keeps going up that I will get very confused and disheartened.

It is baffling because I was staying the same weight and even losing a few weeks ago, and I had the impression I was eating more.

Anyway, my question I think is what should I do to try and fight the thoughts like “this is never going to work” “this is unfair” “this is un-understandable” “even this (intermittent fasting) approach that was a godsend, is no longer working”.