Fix insertSchedule error handling