Deserialization Error despite of variable being destroyed

Hi

I had the same wish as @BerndRuecker in this forum post: How to stop submition of a previously fetched variable in embedded form, but the posted solution doesn’t work any longer on Camunda 7.9.2-ee Spring Boot.

I want to destroy a fetched (serialized) variable before it gets submitted, so that I don’t have any deserialization issues.

I use the code

camForm.on('submit', function() {
   ...
   camForm.variableManager.destroyVariable('documentListSerialized');
   ...
});

which seems to do something: if I try to destroy it two times (same code, but twice), I get an expected error:

Error: Cannot remove variable with name documentListSerialized: variable does not exist.

But despite of the variable being destroyed, I cannot succesfully submit the form, because I get the following error displayed in Tasklist:

An error happened while submitting the task form :
Cannot submit task form 363ba255-a130-11e8-9559-c48e8ffa7ccb: Cannot deserialize object in variable 'documentListSerialized': SPIN/JACKSON-JSON-01007 Cannot construct java type from string 'org.hibernate.collection.internal.PersistentBag<java.lang.Object>'

This is strange, isnt’ it?
Björn

Don’t know, what I have changed. But in the meantime the solution of the mentioned forum post is working.