Why does this while loop give me an error?

While loops always produce this error in BPs, at least in my experience, and people here strongly advised against trying to use While Loop. I believe that it’s being called numerous times within one tick and that causes the error. You should change the algorithm to use Event Tick or a Timer to do what you want to do.