Execute AppleScript with CalendarLib EC library

Hi,
I've recently updated my Mac to MacOS Sonoma and discovered that one of my macros stopped working. The macro uses Execute AppleScript action with Shane Stanley's CalendarLib EC library. The script worked fine on MacOS Ventura.

I've created a minimal reproducible example of the AppleScript (pasted below). On MacOS Sonoma it works fine when executed in the built-in Script Editor app, but fails when run in Keyboard Maestro using Execute AppleScript action. The script fails on the line set theStore to fetch store. The Keyboard Maestro reports that the task failed with status 11.

At the beginning I thought it might be caused by incorrect permissions. But I reset all the permissions using tccutil reset All and the problem still persists. Currently, in System Settings, under Calendar, neither the Script Editor app, nor the Keyboard Maestro occurs.

Can anyone confirm if the problem occurs on other machines?

The AppleScript script:

use script "CalendarLib EC" version "1.1.5"
use scripting additions

set theDate to (current date)

display dialog "date: " & theDate
set theStore to fetch store
display dialog "1"

set theCal to fetch calendar "Home" cal type cal cloud event store theStore
set theEvents to fetch events starting date theDate ending date (theDate + 1 * days) searching cals {theCal} event store theStore

if theEvents = {} then
	display dialog "No event today in calendar Home"
else
	display dialog "Found " & (count of theEvents) & " event(s) today in calendar Home"
end if

In the meantime I've checked that adding the full calendar access to Keyboard Maestro didn't change anything – the script still fails.

I've discovered that the same occurs when running the script from terminal via osascript. I've also found a similar post on Late Night Software forum. I guess the Keyboard Maestro's Execute AppleScript action actually runs osascript, so this might be a reason.