Cause
Calendar events are available only after an appointment is confirmed and scheduled. Approval-pending, confirming, rejected, expired, and canceled requests do not expose a calendar artifact.Fix
Refresh the appointment. Offer add-to-calendar only when its state isscheduled and calendarEventUrl is present, then call the same operation again.