Setting variable on the processInstance gets cancelled when ExternalTask fails

Because handleBPMNError on the External Task Service doesn’t handle the errorMessage variable (although this seems to be supported in the modeler) we are explicitly (and asynchronously) setting the variable in the process instance like so

`processEngine.getRuntimeService.setVariable(task.getProcessInstanceId(), "my-var-name", "my-var")`

this variable disappears. Why is it so, and is this behaviour documented somewhere?