When rules on actions sets work differently. The conditions will trigger based on the property values present on screen load, not on update of previous logic. So in your case, the when on finish assignment is considering the value of SETFLAG before the data transform ran. All the whens o click will run based on conditions places when the screen was rendered last time. You have to find a logic so that the screen renders again after SETFLAG is set so that the whens after run on the new condition.
@PratikA17159775 - Add a hidden control and add the flag property on the section where this button is present. This setting will update the UI side and server side same data when the flag is changed and when condition works as expected.
@PratikA17159775 - Can you try calling the data transform within the refresh section action instead of calling standalone data transform. Because the UI is not updated when flag is changing.