**System Information**
Operating system: Windows 10
Graphics card: Nvidia GTX 1070
**Blender Version**
Broken: 2.83-3.0
**Short description of error**
Sometimes, duplicate keymap entries can lead to both entries being discarded. This is especially apparent for the selection hotkeys. In this case, using X-ray selection tools, the modal keys can both be removed, despite there being no apparent reason as to why both are removed. I don't know another way to reproduce this behaviour without the addon, as it does not appear in the regular selection tools, though I have seen it happen elsewhere in Blender, unfortunately I don't have a way to reproduce those.
**Steps to reproduce**
1. Go to Edit>preferences
3. Install the addon X-ray selection tools from this link: https://captain-cirno.gumroad.com/l/DaLdj
2. Go to Edit preferences > keymap & search for "box select x-ray"
{F12787511}
3. If there are not as many entries, try to disable and enable the addon a couple times
3. Set the first item to Set selection, no modifiers and tweak input
4. Set the second item to expand selection, with ctrl as modifier and tweak input
5. Set the third item to subtract selection with alt as modifier and tweak input
6. Set the fourth item to intersect selection with ctrl+shift as modifiers and tweak input
7. Add multiple dummy entries; these should be automatically populated when creating a new custom keymap, but can also be added manually.
8. Gradually go over all the dummy entries, while leaving the entries from step 4,5,6,7 in-tact. For the dummy entries, disable the selection mode and remove the modifier keys by hitting the "Any" button twice.
9. Notice that the result is that there are either less entries than the ones that should be left untouched and/ or that the ones left untouched were altered due to the items jumping in the list. On other occassions, duplicate entries are not merged.
**Expectation**
The modifiers should only be removed to the point where the only remaining keymap entries are from step 3,4,5,6 and those that are different from these.
However, this is not the case.
{F12788306}
Furthermore, I don't expect the entries to jump around in the list. This also occurs when changing the keymap without an active search.
{F12788297}
In addition, I expect duplicate entries to be merged, since that's what happens for regular keymap items.
{F12788291}
**Related problem to keymap 'corruption':**
https://developer.blender.org/T94606