Error Lock Task Connection with Exclusive Gateway

In your rules, you check for target type:

if (target.type === "bpmn:ExclusiveGateway") {
  return false;
}

When a connection is reversed, it’s actually the source which you need to check. In such case, you will have to do some additional checks to actually allow the connection in the valid cases.

Have a look at a similar post: How to config only one flow between two elements?