Event subprocess not completing, stays active in execution

In our process we have something like in the image below.
If error happens subprocess is activated, user task created, once the user task is completed we return to the last task in process and this should end the subprocess, but it leaves it as running instance because subprocess is still active in execution table.
Do you have any solutions for these?

Does this help.

The BPMN standard doesn’t have a way of doing that - once you’ve interrupted the process with an event sub process you can’t return.

You can do this with the Camunda API though, take a look at this example:

Yes, this is exactly what we have implemented.
My “Return to last task” is using delegate expression which calls that API from that link.
But somehow subprocess with generic error remains active.
Also, one more problem I have encountered is that if “Return to last task” calls end event in the flow, because I want to skip the task that failed, it will call end event, but it won’t close the flow, not even proceed with the flow since that flow is called within the other one.
It just remains Active, in ACT_RU_EXECUTION I can see my subprocess active.

@MelaFelec - did you ever figure out what was causing this? I am facing the same issue, with same scenario.