I found next executing itself infinitely. I think this is an abstraction of my code that replicates the problem:
next