If I walk away in the middle of an unsolved problem, it persists in the back of my mind and is mentally exhausting. I won't be able to sleep or let go of the problem; only potential solutions race around my mind.
However, if there is a clear boundary of work accomplished, I break the build with a simple syntax error and avoid thinking about the next task. I can step away from work completely, without any lingering thoughts, and the next time I am back at it, the syntax error helps me jump in right where I left off.