Huh? Iron filings fly up because of the principle of minimum potential energy. They can lose potential energy by moving closer to the magnet, so they do. No energy is gained - potential energy is converted to kinetic energy, then heat when they hit the magnet.
Your answer is basically a tautology: if we observe work being performed, there must be some potential energy being converted, that’s what the potential energy is; the ability to perform work. The real question rather is: why doesn’t the same thing happen when I get a stick close to wood shavings? How is energy stored in a magnet in a way that is not stored in a stick?
Because stick field is not a thing? Well, I guess there's gravitational fields, but those are not dipoles and they're really weak. Magnetic fields of large aggregates aren't simple to model, and there are some very complex systems, but individually they are very simple and well modeled.