ChildRotation and parentrotation not applying

THis is my code. I am not sure how to fix the child part of this. nothing at all happens

    void StartCrouching()
{
    // Adjust parent rotation
    parentTransform.rotation = Quaternion.Euler(45.0f, parentTransform.rotation.eulerAngles.y, parentTransform.rotation.eulerAngles.z);
    
    Debug.Log("Subtracting parent");
    // Offset child position
    childTransform.localPosition += new Vector3(0.0f, -1.0f, 0.0f);

    Debug.Log("Subtracting child");
    // Subtract 45 from the current X rotation of the child
    childTransform.rotation = Quaternion.Euler(-45.0f, childTransform.rotation.eulerAngles.y, 0);
}

void StopCrouching()
{
    // Reset parent rotation
    parentTransform.rotation = Quaternion.Euler(0f, parentTransform.rotation.eulerAngles.y, 0);

    // Reset child position
    childTransform.localPosition = originalChildPosition;

    // Add 45 back to the current X rotation of the child
    childTransform.rotation = Quaternion.Euler(
        childTransform.rotation.eulerAngles.x + 45.0f,
        childTransform.rotation.eulerAngles.y,
        0
    );
}

That just sounds like you wrote a bug… and that means… time to start debugging!

By debugging you can find out exactly what your program is doing so you can fix it.

Use the above techniques to get the information you need in order to reason about what the problem is.

You can also use Debug.Log(...); statements to find out if any of your code is even running. Don’t assume any of it is.

Once you understand what the problem is, you may begin to reason about a solution to the problem.

Remember with Unity the code is only a tiny fraction of the problem space. Everything asset- and scene- wise must also be set up correctly to match the associated code and its assumptions.