It is absolutely trivial that separating hydrogen from water uses energy. Then, when you burn it, you get water and energy back. That is the whole point.
What wasn't obvious to me from the parent comment was why it is apparently completely impractical. No energy conversion has an efficiency of 100% so the answer couldn't just have been "because thermodynamics" but as other comments have since revealed, it is because _current_ hydrolyzers only operate on an efficiency scale of 60-80%.
What do you imagine is the raw efficiency of making hydrogen from. NG, vs the enthalpy of the input gas?
BTW, "electrolysers". Hydrolysis is a thing plants do.