Cannot be passed from one context to another. The current context is 0x335a69de and the argument value originates from context 0x9c55e2e

var postJSON = JSON.stringify({
    "xhtml64": xhtml64,
    "idUser": genericUser,
    "token": token
});

var finalizeDocumentObject = JSON.parse(postJSON);

execution.setVariable('finalizeDocumentObject', finalizeDocumentObject);

postJSON;

I get the error below when trying to set variable finalizeDocumentObject as a json type and not as a string.

Any help would be highly appreciated.

The value ‘DynamicObject@73a2d786’ cannot be passed from one context to another. The current context is 0x335a69de and the argument value originates from context 0x9c55e2e.