I did the same experiment in high school chemistry. I believe we added hydrochloric acid as a catalyst or it would take a very long time separate water into its components. We captured the hydrogen and oxygen. We got a small pop and fire out of the hydrogen test tube when we lit it. We took a wood stick, lit it, then blew out the flame, then stuck it into the oxygen test tube and the stick would lite up again.
Physics 101, conservation of energy, the term generally refers to any closed system that produces more energy than it consumes. Such a device or system would be in violation of the law of conservation of energy, which states that energy can never be created or destroyed, and is therefore impossible.
So one does not need to know the specifics of that device, just that it will take more energy to produce hydrogen and oxygen from electrolysis then it will produce.