Smoothly rotate a bone around X axis in LateUpdate()

I would like to activate the shoulder canon of my model by rotating it around it’s local X axis 180 degrees. The model is in an idle animation state when “2” is pressed so I’ve read that the bone needs to be transformed in LateUpdate(). I’ve also read that Lerp() is necessary to achieve a smooth/natural rotation. Here is my code:

public class WarriorController : MonoBehaviour
{
    private bool shooting;
    private Transform gunBone;
    private float _startRotateTime;
    private Quaternion _startRotation;
    private Quaternion _endRotaion;
        
    void Start()
    {
        gunBone = GameObject.Find("gun").transform;
    }
    
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Alpha2))
        {
            shooting = true;
            _startRotateTime = Time.time;        
            _startRotation = gunBone.rotation;
            _endRotaion = Quaternion.Euler(gunBone.localEulerAngles.x + 180, gunBone.localEulerAngles.y, gunBone.localEulerAngles.z);
         }
    }
        
    void LateUpdate()
    {
        if (shooting == true)
        {
            float timeSinceStarted = Time.time - _startRotateTime;
            float percetageComplete = timeSinceStarted / 1f;
            gunBone.rotation = Quaternion.Lerp(_startRotation, _endRotaion, percetageComplete);
            //gunBone.localEulerAngles = new Vector3(gunBone.localEulerAngles.x, 0, 0);
        }        
    }
}

The rotation rotates smoothly but seems to be rotating on the Z axis and not a full 180?

Here is the beginning of the rotation:
155495-startrotate.png

Here is the end of the rotation:
155496-endrotate.png

I believe I’m failing to understand how to work with Quaternions. Please advise! Thank you!

All I really needed was the Transform.LocalRotation…

This is what is working for me:

using UnityEngine;

namespace GunController
{
    public class GunController : MonoBehaviour
    {
        private bool _isLerping = false;
        private bool shooting = false;
        private float _startRotateTime;
        private Transform _gunBone;
        Quaternion _gunBoneHomeRotation;
        private Quaternion _gunBoneStartRotation;
        private Quaternion _gunBoneEndRotaion;
        
        private void Start()
        {
            _gunBone = GameObject.Find("gun").transform;
            _gunBoneHomeRotation = _gunBone.localRotation;                
        }

        private void Update()
        {
            if (Input.GetKeyDown(KeyCode.Alpha2))
            {
                if (shooting == false && !_isLerping)
                {
                    shooting = true;
                    _isLerping = true;
                    _startRotateTime = Time.time;

                    _gunBoneStartRotation = _gunBone.localRotation;
                    
                    float toAngle;
                    Vector3 toVector;
                    var toAngleAxis = _gunBoneStartRotation * Quaternion.Euler(180, 0, 0);
                    toAngleAxis.ToAngleAxis(out toAngle, out toVector);

                    _gunBoneEndRotaion = Quaternion.AngleAxis(toAngle, toVector);
                }
                if (shooting == true && !_isLerping)
                {
                    shooting = false;
                    _isLerping = true;
                    _startRotateTime = Time.time;
                    _gunBoneStartRotation = _gunBone.localRotation;
                    _gunBoneEndRotaion = _gunBoneHomeRotation;
                }
            }
        }

        private void LateUpdate()
        {
            if (_startRotateTime <= Mathf.Epsilon) { return; } // Protect against NAN
            if (shooting)
            {
                RotateGunBone(_gunBone, _gunBoneStartRotation, _gunBoneEndRotaion, _startRotateTime);
            }
            if (!shooting)
            {
                RotateGunBone(_gunBone, _gunBoneStartRotation, _gunBoneEndRotaion, _startRotateTime);
            }
        }

        void RotateGunBone(Transform bone, Quaternion from, Quaternion to, float startTime)
        {
            float timeSinceStarted = Time.time - startTime;
            float percetageComplete = timeSinceStarted / .5f;
            bone.localRotation = Quaternion.Lerp(from, to, percetageComplete);
            if (percetageComplete > 1.0f)
            {
                _isLerping = false;
            }
        }
    }
}    

This is an amazing tutorial on Quaternions!