Check if GetComponent actually returns the component. It will return null if it cannot find it and your script will fail the first time you want to do something with the script.
if (!script) {
Debug.Log("Script not found!");
return;
}
The question is why the script cannot be found. It’s obviously not on the prefab you try instantiate or it got deleted at some point. Check that you actually instantiate the right object, that the script is on the object (and not on a child) and that the script is on the clone.