It's because you're trying to cast a `Component[]` to a `Renderer[]`, which won't work. The as operator will silently return null if the cast did not work.
Try this instead:
var components = GetComponentsInChildren(Renderer);
for (var component in components)
{
var renderer = component as Renderer; // Renderer is a Component, so it's OK.
renderer.enabled = false;
}
The line of code that was faulty in your provided code snippet wasn't the for loop. It was this:
gos = GetComponentsInChildren(Renderer) as Renderer[];
The cast (`as Renderer[]`) would return `null`, because `Renderer[]` isn't derived from `Component[]` and vice versa.