Companion stops working when executing while loop

Companion is not responding to me doing “do it” in this looping block.
imagen
The loop IF has termination, there is a block that when the image sprite touches the edge of the screen the variable is passed to “true”, breaking the loop.
imagen

So what’s going on?

I did the same loop with a watch and it works perfectly, unhindered. But unfortunately I would have to have too many clocks because there are too many sprites. So yes or yes I need a loop block that generates the same function as this one.

The strange thing is that it does not throw me any error, only the screen is frozen and then it tells me that the companion stopped working and that if I want to wait for it or not, but I wait and I keep waiting for a long time and in the end nothing happens.