Adding variable in external task throws "The corresponding process instance could not be resumed" Exception

I use the camunda-external-task-client-spring-boot and want to add 2 variables. When trying to complete the task by using the API externalTaskService.complete, I get the exception " TASK/CLIENT-01009 Exception while completing the external task: The corresponding process instance could not be resumed*

public ExternalTaskHandler counterPartyLoader() {
return (externalTask, externalTaskService) → {

// create an object typed variable
VariableMap variableMap =
Variables.createVariables()
.putValue(“dep_borrow_no”, Variables.objectValue(“test”).create())
.putValue(“cash_acc_borrow_no”,Variables.objectValue(“test2”).create());

      externalTaskService.complete(externalTask, variableMap);

Is there an error in the camunda logs?

I found my mistake. I wanted to pass a string and not an object.

VariableMap variableMap =
Variables.createVariables()
.putValue(“dep_borrow_id”, Variables.stringValue(“test”))
.putValue(“cash_acc_borrow_id”,Variables.stringValue(“test2”))