ECMAScript 2021+ rule-based scripts fail when using cache.get(): The Context is already closed

I have some scripts which use the cache.get() and cache.put() funtionality.
Yesterday I upgraded my installation to OH 3.3, so maybe thats the reason, because now script execution fails when coming to a

let cachedValues = cache.get("test") || {};

In the log there is an ERROR message:

2022-07-15 15:24:24.410 [WARN ] [.internal.OpenhabGraalJSScriptEngine] - Failed to retrieve script script dependency listener from engine bindings. Script dependency tracking will be disabled.
2022-07-15 15:24:25.877 [DEBUG] [ript.ui.lights_on_brightness_updated] - [lights_on_brightness_updated]
2022-07-15 15:24:25.884 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'lights_on_brightness_updated' failed: java.lang.IllegalStateException: The Context is already closed.

and further script execution is aborted.

Any ideas what is going wrong here? I shortened the script to the following, still raising the error message:


let lScriptCache = cache.get("ceiling_lights_state", () => ({}));
console.debug("lScriptCache = " + JSON.stringify(lScriptCache));

+++ UPDATE +++
I just noticed, that the issue is probably related to me putting an JSON Object in the cache. Now I am using JSON.stringify() for the cache.put and the cache.get is working than. But as I also did rewrite the whole script to use “let” instead of “var” and I am executing my code in an anonymous function now, so the issue was probably somewhere else…