If there is a difference between compiled mode and processed mode, there is a bug. The only question that remains is whether it's a compilation bug or a processing bug.
From my understanding, the delimiter should be executed at the end of a pass through a loop and not in the beginning of the next pass. That implies that $index is the same through the whole pass which in turn implies the bug is in compiled mode.