A tankless WH requires periodic maintenance. Hard water deposits will occur inside of the heater, and restrict the flow through it.
If you're lucky, it was installed with the needed fittings to do a descaling procedure on it. Generally, that needs to be done annually. Basically, you close it off from the rest of the system, then pump a weak acid through it for what might take a couple of hours until all of the deposits are dissolved, then flush that out, and restart the system.
If you don't have those fittings, you'll need to repipe it to put them in.
The mineral deposits not only restrict the flow, but act like an insulator, so it can't make as hot water. Keep in mind, a tankless system is sort of like passing your hand through a candle flame...do it slowly, you'll transfer a lot of heat and maybe burn yourself, but do it fast, and you'll not notice it at all. Then, compare it to a blowtorch versus a birthday candle.
The flow sensor might be all gummed up with mineral deposits, and isn't recording the fact there's any flow so it won't turn the thing on. That might get solved after descaling it, but that part might need to be replaced.