We used to have that problem periodically with our system.
There is an inline "paddle wheel" that spins and tells the "brain" how much water is flowing, thereby letting it know how much/how fast to heat the water.
We have hard water, which gummed up the paddle wheel a bit and caused it to not work unless a LOT of flow was going past it (typically if we were out of town/not using water for a few days this would happen).
Took it off and blew it to hyper-speed with compressed air to fix it, then learned I could just tap on it without taking it apart. Hasn't happened in a long time now.