EKEventStore unable to save events

I have a feature where I need to write some events to the calendar. It's not working saying Calendar is read only. So I tried the sample app from Apple - Repeating lessions and drop in lessions from link below https://developer.apple.com/documentation/eventkit/accessing_calendar_using_eventkit_and_eventkitui

Drop in sessions which uses EKEventEditViewController works fine. But when I run Repeating lessions which requires calendar permissions it keeps saying Calendar is read only. I have hit allow on the access permissions alert and also check settings which shows app has required permissions.

can someone help why this is the case? if its a Calendar issue where do you set the modifiable permissions for it? How is EKEventEditViewController able to save events if the Calendar is readonly.

EKEventStore unable to save events
 
 
Q