At some point you should receive the lecture about how, in beginning classes, there are plenty of simplifications and outright mis-truths told in order to make understanding easier. The supposed "law" of conversatoin of energy only applies under certain specific scenarios and -- while those scenarios are quite common in everyday life -- once you start playing with quantum mechanics you've violated the assumptions upon which the "laws" were founded.
Quantum physics is full of many non-intuitive and seemingly contradictory results. :-)