How do you know the loop is not incrementing? I don’t see any wait blocks in your loop so you’re only going to see the last successful/true value for the if
condition.
You’ll need to do some debugging to figure out which variable(s) including i have the values you expect them to and which do not.
I use this method: Debugging in Thunkable X (Video)