iCloud Calendars not being read


I am trying to read my calendar events for a widget, and my events do not seem to be fetchable by Scriptable. I do have events scheduled for today in various iCloud calendars, but no script I write or download reads them.

For example, this simple script returns nothing despite events existing in iCloud. I have already given Scriptable access to my calendars.

let todayEvents = await CalendarEvent.today([])

for (const event of todayEvents) {

Am I doing something wrong? It is also not working with any downloaded scripts.

The code is correct, check scriptable permission to access calendars