Learning from failure: boosting cycling endurance of optical phase change materials