People underestimate the variation in NEAT, non-exercise activity thermogenesis.
Often on prolonged diets, your NEAT can unconsciously decrease from a series of small decisions like choosing to take the elevator when you usually take the stairs, parking nearer to your destination, etc. and even things like fidgeting less.
You can kinda get around this with things like step counters so you can track how many steps per day you normally walk, and then if you notice you're suddenly walking fewer steps, you can consciously choose to walk more to keep your activity level at your baseline.
For example, you might average 8,000 steps per day but after a few months on a diet, you find yourself walking 4,000 steps per day naturally so you can just choose to go out for a walk after dinner to maintain or increase your baseline level of activity.
When people talk about changes in metabolism, this is normally the culprit.