Gateway scripts not executing the first time the tag value change

After we upgraded our servers last week from Ignition 8.1.3 to 8.1.6 we have had some trouble with gateway scripts not executing the first time the tag value changes.
Example: If ‘Tag1’ is False and then changes to True the script won’t execute, but when ‘Tag1’ goes back from True to False again the script executes successfully. And then it executes when it goes from False to True.

We can see in the gateway that the script hasn’t executed or failed. It is as if the script does not register that the value has changed the first time it changes, after the second time the value changes the scripts executes the way they are supposed to.
Although in most of our cases the tags are resetted in the scripts. So the tags get stuck in the wrong state.

Some days after the upgrade it happened again after we patched the servers and the gateway were restarted, so once again the values had to change twice in order to work properly.
We tried to restart the UDTs containing the tags and when we did that the scripts executed on the first value change.

Has anyone else seen this behaviour?