LocalRotation does not work

why LocalRotation does not want to work in this line
 gmo.transform.localRotation = Quaternion.identity;

here is the script

void Start()
     {
         rb = GetComponent<Rigidbody>();
     }
     void OnTriggerStay(Collider other)
     {
         if (other.CompareTag("Player"))
         {
           
            
                invite = true;
                rb.isKinematic = true;
                rb.detectCollisions = true;
                if (timeCount >= 2.0f)
                {
                    
                    rb.isKinematic = false;
                    rb.detectCollisions = false;
                    transform.SetParent(other.transform, true);

                gmo.transform.localRotation = Quaternion.identity;

                BlazeIt = gameObject.GetComponent<HingeJoint>();
                    BlazeIt.connectedBody = targetJoint;

                    Debug.Log("Good");
                }
                timeCount = timeCount + Time.deltaTime;

            


         }
     }

    void Update()
    {


        if (invite == true)
        {
            if (Input.GetKey(KeyCode.T))
            {
                transform.position = Vector3.Lerp(startMarker.position, targetTransform.position, timeCount);
                gmo.transform.localRotation = Quaternion.identity;
                // transform.DORotate(pos, duration, RotateMode.Fast);
            }
        }
        

       

    }

}

*gmo.transform.rotation = Quaternion.identity;