Variable value lost when set value in a multi-instance complete condition script

I set a process Boolean process variable to false in the complete condition script in a multi-instance human task.
The log shows the variable value is set correctly in my test case it is ‘false’.
But after that node, I have a XOR gateway to make decision using that process var, in the condition script I logged the variable again, it becomes null.
And it seems if a Boolean value is null, the condition is still evaluate to true.