>>13282219Because there is no such thing as a portal gun, that works to the specifics as depicted.
A better way to look at this would be to assume you have dug a hole from one side of the moon, to the opposite side of the moon.
You make this hole a perfect vacuum, and run a coil of wire around the circumference of the entire hole from one side of the moon, to the other.
Then you drop a magnet from one side of the hole, gravity pulls it down, and it generates an electrical potential in the coil.
Does gravity keep pulling this magnet back and forth, while we suckle energy from the harmonic motion?
Yes and no.
It will work, for a time, but the removal of energy from this closed system would eventually make this magnet settle in the dead center. No more free energy.
What would stop the magnet? The counter acting force from the coil. Oh no! Resistance is real!
No breaking of thermodynamics here, just a sad exercise of harmonic motion until the system sits at rest.