Why NullReferenceException when nothing is null?

Here is my code:

protected void TerrainOn(Transform clop)
    {
        MediumTank tank = currentUnit;
        Collider[] colliderList = Physics.OverlapSphere(clop.position, 0.5f);
        if (colliderList.Length != 0)
        {

            switch (colliderList[0].tag)
            {
                case "town":
                    GameObject townhexon = GameObject.Find("townHex");
                    tank.CurrentDefence = tank.InitialDefence + townhexon.GetComponent<Town>().town.VehDefence;
                    break;

                case "plains":
                    GameObject plainsHexOn = GameObject.Find("plainsHex");
                    tank.CurrentDefence = tank.InitialDefence + plainsHexOn.GetComponent<Plains>().plains.VehDefence;

                    break;
            }
        }
    }

Unity throws a null reference exception saying that clop is not set to an instance of an object on line 4 when I try to execute TerrainOn(), but clop is definitely set to a valid transform in the inspector.

This is not how you should approach this.
If you can set clop in the inspector this means it is a member variable a la

public class SomeClass {
      public Transform clop; //member variable
      
      public void TerrainOn(Transform clop) //clop is local variable
      {
             Debug.Log(this.clop); // member variable
             Debug.Log(clop); //clop is local variable
      }
} 

also just because you assign somethin in the editor does not mean that the code could not overwrite the value somewhere.

So if you want to claim that “nullref even though variable is not null” then please prove this by adding a Debug.Log(clop); in line 3.