I would guess that you’re using a random int between 0 and LENGTH.
But… you use it once to do the ‘is valid’ test, and the second time to read from the array. The second time, sometimes, the random int = LENGTH, but the last index is actually LENGTH - 1.
A much easier way to get random objects from an array is using the RANDOM node