Could be one of two issues here. Either your old controller could have been faulty, or the other one, the new controller has a firmware update or HW revision that fixes the issue your old one had. Impossible to know without deeper dives in HW & FW revisions.
For me, it never went away. I had an Xbox One S controller before with the same issue. Bought the Xbox Series controller last year for Elden Ring, same issue on Windows. Gave up, and just got a longer USB C cable.