Problem in updating a custom procedure in causal cluster

Hello,
as in the subject, I have an issue when I try to modify an existing procedure.
For instance, if I register a new procedure with an error, just like the following one:

CALL apoc.custom.asProcedure('TrialProcedure','MTCH (n {ID:$id} ) RETURN n.ID as element','read',[['element','NUMBER']],[['id','NUMBER']])

even if I later remove it, and register it again after fixing the error in the MATCH statement, the db responds again with the wrong version (the older one).
I also tried to invalidate the query cache by calling

db.clearQueryCaches()

but again the issue was not solved.
The only way to solve it was to reboot nodes one by one.
Is there another way to update it without using this workaround and without disabling the cache at all?

You can try this plugin to build your stored procedures in Javascript.

https://github.com/neo4j-field/js-stored-procedures

It removes the need to restart the cluster. You may have to tune the updates detection time as the default value is 1 hour.

As @anthapu pointed out, you may need to tweak the refresh interval. From 4.0 manual

https://neo4j.com/labs/apoc/4.0/cypher-execution/cypher-based-procedures-functions/#_custom_procedures_with_apoc_custom_asprocedure

4CD36E2E-A90E-4186-91AD-5CBBF1AEB33B.png