Unity has a preview package of their new input system as Rewired can be expensive for some devs. I'll recommend going with the preview package and the legacy system causes bugs like the ones you experienced. Brackeys even has a tutorial on the new system