Camera goes crazy if it has player as a parent

I am extremely new to Unity and I’m losing my mind over this. I made a ball as a player to test movement and some camera stuff and I ended up wanting to try and make the camera act as if it was the player itself, with mouse movement inputs.
Only issue is, if the camera is the player’s child, the input part works perfectly, but when I move the player the camera just goes spinning, but if I detach it from the player, the horizontal movement stops working completely.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CameraController : MonoBehaviour
{

    public float MouseX;
    public float MouseY;
    public Transform Player;
    public Transform Head;

    public float Angle;

    void Update()
    {
        MouseX = Input.GetAxis("Mouse X") * 200 * Time.deltaTime;
        Player.Rotate(Vector3.up, MouseX);

        MouseY = Input.GetAxis("Mouse Y") * 200 * Time.deltaTime;
        Angle -= MouseY;
        Angle = Mathf.Clamp(Angle, -90, 90);
        Head.localRotation = Quaternion.Euler(Angle, 0, 0);
    }


}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.InputSystem;
using TMPro;

public class Movement : MonoBehaviour
{
    private Rigidbody rb;

    private int count;

    private float movementX;
    private float movementY;

    public float speed = 0;
    public float jumpForce = 5f;

    public TextMeshProUGUI countText;

    private bool isGrounded = true;

    public GameObject winTextObject;

    void Start()
    {
        rb = GetComponent<Rigidbody>();
        count = 0;
        SetCountText();
        winTextObject.SetActive(false);
    }

    void OnMove(InputValue movementValue)
    {
        Vector2 movementVector = movementValue.Get<Vector2>();

        movementX = movementVector.x;
        movementY = movementVector.y;
    }

    private void FixedUpdate()
    {
        Vector3 movement = new Vector3(movementX, 0.0f, movementY);
        rb.AddForce(movement * speed);
    }

    void OnTriggerEnter(Collider other)
    {
        if (other.gameObject.CompareTag("PickUp"))
        {
            other.gameObject.SetActive(false);
            count = count + 1;
            SetCountText();
        }
    }

    void Update()
    {
        if (isGrounded && Keyboard.current.spaceKey.isPressed)
        {
            rb.AddForce(Vector3.up * jumpForce, ForceMode.Impulse);
            isGrounded = false;
        }
    }

    void OnCollisionEnter(Collision collision)
    {
        if (collision.gameObject.CompareTag("Ground"))
        {
            isGrounded = true;
        }
    }

    void SetCountText()
    {
        countText.text = "Count: " + count.ToString();

        if (count == 8)
        {
            winTextObject.SetActive(true);
        }
    }
}

For your case, it might not be the best solution to place the camera as a child of the ball. Instead, put the camera in a separate hierarchy, have the camera follow the ball, and have the camera face the direction the ball is moving.

void Update ()
{
	MouseX = _InputManager.GetPlayerHorizontalRotationInput() * 200 * Time.deltaTime;
	Player.Rotate (Vector3.up, MouseX);

	MouseY = _InputManager.GetPlayerVerticalRotationInput() * 200 * Time.deltaTime;	
	Angle -= MouseY;
	Angle = Mathf.Clamp (Angle, -90, 90);

	var headPosition = Player.transform.position;
	headPosition.y += 1.0f;//Keep cam above ball
	Head.transform.position = headPosition; //Cam follows ball

	//Have cam face direction ball is moving
	var playerDirection = (Player.transform.position - lastPlayerPosition).normalized;
	if (playerDirection != Vector3.zero) {

		var targetHeadRotation = Quaternion.LookRotation (playerDirection);

		//Face direction immediately
		//Head.transform.rotation = Quaternion.LookRotation (playerDirection);

		//Gradually face direction
		Head.transform.rotation = Quaternion.Slerp (targetHeadRotation, Head.transform.rotation, 50f * Time.deltaTime);
     }

      lastPlayerPosition = Player.transform.position;