I use a true and false boolean called loopErrorFlag. Under certain criteria the workflow use a case switch to a Java Edit variable which must edit the variable to true. The photos below show the example workflow, variables before the java edit node, configuration of the java edit node and the variables after executing the error node. (I think it is something to do with the case switch end).
to my knowledge this is by design. Flow variables are transferred regardless of branch active/inactive status. And then considering you have 2 flow variable with same name the one from upper port is taken (the one that never gets changed in your case). But if this is all you are doing inside Case Switch nodes and not just example don’t think you need them. You use Rule Engine Variable node to change the variable to true if condition fulfilled.
Thanks @ipazin. The flow is not as simple as shown in the photo. I just simplified the flow for the example. I was using the rule engine variable before. I was just testing different solutions and could not figure out why this one was note working. Thanks for your help.