You’re right, but the transformation is subject to the 2nd law of thermodynamics. The useful work you can do is diminished, and you’re left with entropy. Energy is neither created nor destroyed, but we don’t care about how much waste heat we have available, because nothing can be done with it.