Trigger generating org.neo4j.graphdb.NotInTransactionException: This transaction has already been closed

Hi,

I'm getting the following error:

Error executing trigger myTrigger in phase afterAsync
org.neo4j.graphdb.QueryExecutionException: Failed to invoke function apoc.convert.toJson: Caused by: org.neo4j.graphdb.NotInTransactionException: This transaction has already been closed

The code for the trigger is:

"CALL apoc.load.jsonParams(
"http://localhost:8082/topics/neodb-cdc",
{
method: "POST",
Content-Type: "application/vnd.kafka.json.v2+json",
Accept: "application/vnd.kafka.v2+json"
},
apoc.convert.toJson({records:[{key: "neo4j_update", value: {
createdNodes: $createdNodes,
deletedNodes: $deletedNodes,
createdRelationships: $createdRelationships,
deletedRelationships: $deletedRelationships,
removedLabels: $removedLabels,
removedNodeProperties: $removedNodeProperties,
removedRelationshipProperties: $removedRelationshipProperties,
assignedLabels: $assignedLabels,
assignedNodeProperties: $assignedNodeProperties,
assignedRelationshipProperties: $assignedRelationshipProperties
}
}]})
) YIELD value
RETURN value"

Sometimes it works, sometimes it doesn't.

Please advice, thanks!