You don't create energy, you convert it from one form to another.
And neither gravity nor magnetism is a source of energy.
All right. Here's is what you have neglected that you would have learned if you had read about electricity or magnetism or about perpetual motion machines:
Thrusting a pole of a permanent
magnet through a coil of wire, induces an
electric current in the coil (as you know). What you neglected is that the current in turn sets up a
magnetic field around the coil, making it a magnet. This magnet, in turn,
opposes the movement of the weight.
In other words, it takes
work to
push the pendulum weight through a magnetic field. Since it was only moving via inertia, the opposing force will extract the kinetic energy of the weight and rapidly bring it to a stop.