Try replacing your
Component type to a
script.enabled = false will work.
Component is the base class for anything that can be attached to a gameobject, it is very barebones, and does not support enabling/disabling.
MonoBehavior class inherits all the functionality of
Component but adds some extra features. For your purposes, what’s important is that it supports enabling/disabling via scripts or the inspector.
Here’s a more detailed SO answer which explains the differences between Component, Behavior and Monobehavior if you’re interested.