Instantiate with parameter not working

This not working ang giving me error:

//Ignore random spawn position in instantiate its not relevant
GameObject ship = Instantiate(spawnableShip_01,new Vector3(transform.position.x + Random.Range(-5,5),transform.position.y + Random.Range(-5,5),0),Quaternion.identity) as GameObject;
    
ship.GetComponent<SpaceShip_Trader>().cameFromStargate = true;

It will even spawn the ship and then always always no matter how else I set it:

NullReferenceException: Object reference not set to an instance of an object

The ship gets instantiated but ship.GetComponent() = null.

This means your ship does not have the component SpaceShip_Trader attached to it, because your prefab (spawnableShip_01) does not have it.