loopindex only works for system loops like repeats and for loops.
The loopindex parameter lets you specify the name of a for loop.
loopindex does not work for Array "For each xy" and Dictionary "For each key". Each object has its own way of getting the current index by expression.
It worked this way in Construct 2 as well.
For your use case, an array seems more suitable.