The behaviour is entirely expected.
On your first iteration, you replace the 0th element of the initialised array. On your second iteration, you replace the 1st element of the initialised array, rather than the result of the replace array primitive from the previous iteration.
Change the tunnels of the for loop to shift registers, and you'll pass the result of the previous iteration to the current iteration.
If you change your initialise constant to True, or the array length to an odd number (but not both), you'll easily notice that when the for loop finishes, only the last element will be changed.
You can figure out 'bugs' like this (read: shortcomings in your code) via Highlight Execution and probing.
---
CLA