And it’s not about wether I like my work or not, it’s just that I have more important things to think about or that I just let my mind wander.
I already spent most of the day on the problem, and that exceeds my natural interest in it.
I think I'd like a job with truly flexible hours: work all evening on something if it's occupying my thoughts anyway, but then get a full 'evening' to chill, full night's sleep, and start the next day when I'm ready. I can do the former, but I'm still going to be expected to dial in ~to pointlessly summarise it~ for stand-up in the morning. (No I don't have young children, yes yes this wouldn't work for everybody.)
I've started billing that. Not always, rarely in full, but I bill some of it. It's not just for the money but started more like "what exactly do I work? Best way to know is to bill it".
So you don't really stop working at 6pm..