Buggy while loops, stop working if you test them separate

So I have 3 while loops, where if visualsearch > 0 then move to the next visual search.
And they work perfectly IF I start the macro from the start.
From the moment I go the the line of the second visual search and test it out, for some reason UI.vision just ignores the while and gives an error.

Example:

Loop 1
VisionlimitsearchArea: area=0,0,-1,-1
Visualsearch: PICTURE1
While ${PICTURE1}>0
excutescript_sandbox return ${PICTURE1}-1
bunch of xclicks

END
LOOP2
VisionlimitsearchArea: area=0,0,-1,-1
Visualsearch: PICTURE1
While ${PICTURE1}>0
excutescript_sandbox return ${PICTURE1}-1
bunch of xclicks

END
Loop3
VisionlimitsearchArea: area=0,0,-1,-1
Visualsearch: PICTURE1
While ${PICTURE1}>0
excutescript_sandbox return ${PICTURE1}-1
bunch of xclicks

END

===========

Anyone knows why this is? Is there some logic behind it or is this just a bug?

Picture below is what I get if I test my second while, with “play from here” and as you can see. (the picture for visualsearch was NOT shown on my desktop) and instead of repecting the while, It just skips it and gives the error the picture was not there…

What makes it even more weird is: if I copy each loop in a separate macro, they all work! So this troubleshooting makes no sense at all. And I conclude this has to be a bug?

Found the solution: You NEED to say “comment” for your comment lines. I was under the impression that because they become automatically grey, they were comment lines. But this is NOT the case and will mess up your code.