Unity keeps crashing exiting playmode

It has happened multiple times, I enter the editor, hit play, and when i unhit play the editor crashes. This is all i know of my issue, no hints to anything.

Check your code , maybe some function is endless loop

Nope, not by the looks of it. Here is the only C# script I have in the whole project. Also, i copeid this script into a new project, same issue:

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

public class PlayerCamera : MonoBehaviour
    public InputAction PlayerControls;
    public Vector2 Sensitivity;
    Camera ThisCamera;
    Vector2 CameraDelta;
    Vector2 XYRotation;
    float timer = 0;
    public float walkingBobbingSpeed = 14f;
    public float bobbingAmount = 0.05f;
    public float OriginalPosY;
    private void Start()
        ThisCamera = GetComponent<Camera>();
        OriginalPosY = transform.localPosition.y;
    public void OnRun(InputAction.CallbackContext context)
        CameraDelta = context.ReadValue<Vector2>();
    public void Update()
        XYRotation.x -= CameraDelta.y * Sensitivity.y;
        XYRotation.y += CameraDelta.x * Sensitivity.x;

        XYRotation.x = Mathf.Clamp(XYRotation.x, -90f, 90f);
        transform.eulerAngles = new Vector3(XYRotation.x, XYRotation.y, 0f);

        timer += Time.deltaTime * walkingBobbingSpeed;
        transform.localPosition = new Vector3(transform.localPosition.x, OriginalPosY - (Mathf.Sin(timer) * bobbingAmount), transform.localPosition.z);

P.s. none of my hardware throttles according to task manager, and i don’t make any changes in the editor while in play mode.

Not a great solution for everyone, but updating the version from 2023.2.6f1 to 2023.2.20f1 fixed the problem so far.