The peephole optimiser in the virtual machine has a bug that may cause faulty behaviour. It is difficult to characterise what kind of models will trigger the bug. If you suspect that you are affected, you can disable the optimiser by defining the environment variable UPPAAL_DISABLE_OPTIMIER.
Fixed on the 4.0 branch from rev. 2344. The fix has previously been applied on the trunk.