I have similar issues. If I plan out and prepare food, I can stick with my diet, no problems. But often the practical issues of when to eat and what I options I have available during my working day cause me to go off plan.
I was told never let 4 hours go by without eating something. Usually after 3 hours I am hungry. My diet aim is 5/6 small meals or snacks totaling around 1500 cals. On a good day I end up preparing flasks of soup, diet shakes, fruit, topped crisp breads etc.. On a bad day I wait until normal meal times pop to a shop and often overeat. Or end up going home hungry and getting a takeaway or having a huge meal to try to meet my days needs. Also when I am tired my body craves fats and sugars for energy when all I really need is a 10 min power nap somewhere.