Just hit **# on the keypad and the CIPC will enable the button in settings for a factory reset. Sometimes the phone may run into issues or may be unable to register to another tftp server (eg. another CME or CUCM server) due to a bug or maybe due to the security settings tying it to a specific server.
Below is how things look when the phone is still locked.
After hitting **# you will see the "Erase" button appear like below:
Click the "Erase" button and it will be reset.