Sometimes layers created and named in a loop can't be targeted by the name displayed in the layer list. I've seen this happen, and you probably have too. But does anyone know why it happens, and what to do about it?
This is curious. I use loops all the time and haven't run across this one.
I've seen people associate the layer name as the variable name before.
I'd recommend to print the name after it was created to see if the name is what you're expecting it to be. ie. Something odd is that if you use the index of the loop to name your layers, the first one instead of 0 is going to be "".