I have to restart my PC every time I unplug a controller

So I have RA configured with Xinput, using an 8bitdo adapter to use DS4 or other controllers.

If I disconnect the adapter and put it back in, or replace it with a different controller, RA will recognize the Xinput device, but the controller doesn’t do anything in menu or game. The only way to solve this is to restart my PC, and then RA will work normally.

Is there any way I can fix this? It’s really frustrating, and I would also love to use multiple controllers for different systems, and right now I can’t (unless, I guess, I have all of them connected from the start and replace the device index for player 1 every time I want to switch).