Updated my blueprint project to UE5 now there are strange issues

There are some strange infinite loops (I can’t see there any issue) and after the hit of an instanced static mesh component sometimes there is a issue with the Hit item index.

After colliding I want to remove an instance of the instanced static mesh compnent based of the instance index (Hit item).

This code gets executed after clicking the right mouse button. But also without doing that there is an infinite loop.

In UE4 the same code works!