Physics problem

Lets say that some ship with hyperdrive carriers a magnet on board, which is attracted strongly to a magnet on another ship. Lets also say that the magnet is weightless at one side of the ship, and tethered to a string. As the magnet is pulled, the string spins a turbine and generates electricity.

Now lets say that the spaceship is equipped with warp drive, allowing it to move with an acceleration F = A that is not relativistic and does not experience time dilation.

If the ship warps itself away from the magnet in space, and the magnet on the ship flies towards the magnet in space, generating electricity, hasn’t energy been generated from nowhere.

Couldn’t they indefinitely warp away from the planet with the magnet, generating more potential energy than is converted to kinetic energy when the magnet is pulled.

Note that the same thing could be done with a planet, and gravity could pull on an object.

STAR TREK IS A LIE! WHY KIRK? WHY?!?!?!??!?