When I connect the controller, it appears as two different devices (see image below) and this generates conflicts in some games.
How can I solve the problem?
I would like only the second to appear.
That is by design and has nothing to do with the issue you described. The Microsoft
xinputhid.sys driver I piggyback on "proxies" through the HID device with the Xbox One Controller layout and some games pick up both this virtual device via DirectInput and the "real" device via XInput and get confused. I can not offer any solution to that at this point as it's a game engine issue I have no control over. You can see if HidHide helps your case.
The XInput Mode is in beta and what you described is a known behavior that's affecting many games.
As an alternative, you can use the DS4Windows mode along the Ryochan7's DS4Windows software for Xbox Controller emulation.
It is not as straight-forward but you won't have issues with it when using its Xbox Controller emulation.
See the guide: https://vigem.org/projects/DsHidMini/DS4-Mode-User-Guide/