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 act of turning over the top leads to a rise in the object's center of mass, suggesting an enhancement in potential energy.