This happened to me once. It was like attaining enlightenment. My company worked with a F100 that had, as a core piece of their business, a piece of software they'd commissioned in the 80s that they still used in the 2010s to make billion dollar decisions. But no one knew how it made the calculations they relied on. This was before attorneys knew to include
source code in procurement, the original devs at a third party code shop was long gone.
We were already working on something for them, and on a whim, one of their VPs asked my company if we could take a look at it.
So that's how the mathematician at the company (me) ended up waking up, sitting in front of a whiteboard, and losing all concept of time until my wife got home from work at night, not eating, not sleeping, staring at decompiled assembly and stepping through line by line for weeks. (I don't want to say months because I'm sure someone will come roast my ass for taking too long, but "months" is honestly more accurate; in fairness, I was learning every technique used on the fly)
It was a prolonged, repeated flow state that I've only ever experienced during really competitive tennis as a high schooler. Losing all concept of time and space, hyper focused on one task that has completely spread to all parts of your consciousness.