This is because the inversion of the top raises the object's center of mass, which means the potential energy has in fact increased.
The inversion of the top consequently boosts the object's center of mass, indicating an increase in potential energy.