UI vision cannot click on a dynamic button after first attempt

I used storexpathcount to check for the availability of button. Button is not always available but xpath is always same.
In a loop I made it to keep using storexpathcount to check button.
But when I do first test when button is available it can count it. And when button appears after some time while macro is running. It UI vision cannot fetch it it keep saying storexpathcount is zero.
Note I cannot refresh page due to some reasons.

I would use the command “waitForElementVisible” instead of the xpath counter.