How does demagnetization occur?
The best way to demagnetize something is to expose it to a high frequency-high amplitude magnetic field. This can be accomplished by running the control system to spin the rotor at high speed when the rotor is actually stalled, or spinning the rotor at high speed against a control system trying to hold the rotor in a fixed position. These will both expose the rotor to a high amplitude high-frequency field. If such operating conditions are common, particularly if the motor is run near the curie temperature of the permanent magnets, demagnetization is a serious risk and the field strengths (and expected torques) should be reduced accordingly!