To switch the light you need to access the actual light component visibility, not just the root component (unless root component IS the light source).
In this case I assume hierarchy in your bluerpints looks something like:
Root:
- MeshComponent
- LightComponent
You might pull your light component and make it root, this way you would not need to change your code, otherwise instead of root try to get light component from the Lights actor.
If that doesn’t help make sure the Get Actor of Class node returns correct actor.