Energy is the basically a force applied to something over a distance. Now permanent magnets have the force. The problem is that you need to move something by that force to get the energy. (Or you can change the direction of the force which is not possible with permanent magnets) For example you bring one magnet's N pole to another magnets N pole. Now the magnets will move opposite to each other and for that there is an energy you can harvest. But the energy you spent to bring the magnets close to each other will always exceed the energy you get. So it means you cannot use permanent magnets to produce FREE energy. But certainly it is possible (And used) to use permanent magnets for energy generators.
Also bringing two N poles (or S poles) of permanent magnets closer will reduce the magnetic force in each magnets over time and thus make them useless in long terms.
In some experiments it might seem like Magnets are producing more energy than they are consuming but it always that there are some unseen energy spent to make the system working which is not taken into account.
If it is possible to harness energy directly (without movement of the magnets or something in the field from some other force) from a permanent magnet it would violate 2nd law of thermodynamics and thus many of the most respected theories of modern day physics. Which seems very unlikely.