Xbox One X controller not configuring properly

When I first open Retroarch and plug in my official Xbox One X wireless controller via USB-C it shows up as “Logitech F310”. Not correct but at least it works. Then, when I open Retroarch again it shows up as “Generic Xbox controller” and I have to remap all the buttons to make it work. The right analog stick isn’t recognised at all (but it’s recognised in other emulators like Dolphin standalone for example). Bluetooth works but the latency is horrible. Help plz