Not sure whether you have already tried this. We faced similar issue where the flag property used in when rule or expression is set in same button click. We got the issue solved when we did below steps.
1. Add a UI control (may be check box if it is boolean) for that flag property in the same section where you have the button.
2. Set the Control format to 'Hidden', on the Presentation tab of the Control, to hide the field.
3. Set the When condition to 'Other Property' and use the flag and expression.
Below link has more details on why we followed the approach I mentioned above.