How to randomly assign color to objects in an array
I was in Eevee, changed to Cycles and it worked. There was no need to apply the array modifiers, so they are still available.

Further reading: Randomized color with array modifier