I think @Caseda might be on the right track. When playing around in Homeyscript I too had problems when reacting on value changes that it seemed like the flow to change the value change was triggered BEFORE the value in the devices capability reflected the same change. I took another approach but didn’t investigate further what originally went worng when it finally worked.
If this is true, the local tag will give you the right value and the tag from (the same!) device will not. If that fixes your problem, I think you should send in a bug report to Athom.
Maybe this can be tested, I will see if I can create a flow on any of my aqara temp sensors to verify that this can actually happen.
EDIT: so far the local tag and the sensor tag are equal on firmware V5 RC50, so it doesn’t seem to be a problem for me.
When you test the flow in the web interface, I think you can see an error message for the tag that fails sometimes (was it by hovering/clicking on the error icon, or did it just show as a banner on top? I’m not sure).