I've noticed this behavior before regarding how the game "counts" positions in the weapons/gadgets list, mostly from messing with toggling push button code cheats mid-level. Unfortunately I never thought to put 2 and 2 together regarding the key analyzer. I'll demonstrate a few of the quirks I've observed over the years:
Go to any level, and select just the All Guns cheat from your cheat menu (and optionally Invincibility.) I'll use the Dam just for example. Pause the game, highlight a weapon not normally available in the level near the bottom of the list, and select it with the A button. The RC-P90 is a good enough example for the Dam. Optionally unpause, and switch to a double RC-P90, then re-pause. Now input the
All Guns PBC to
disable your extra weapons. Doing this reverts you back to only the weapons / gadgets you started with, plus anything you've picked up, minus anything you've permanently expended (e.g. Covert Modem if you had tossed it.)
Now take note when you move to the weapons list. The game had your cursor position down pretty low, but now that you have deleted most of your inventory, it rapidly has to correct itself to the last weapon / gadget in your inventory. Furthermore, when you move back to the initial overview menu, your weapon's name shows as a single dot. Unpause and re-pause quickly, and it will "correct" itself to Unarmed, even though you are holding a weapon, in this case the RC-P90! And you don't even officially have it in your inventory! (I'd call it a phantom weapon, but that would be misleading, as the name is already taken.)
Now unpause, and play the level as usual, and you will have free temporary access to the chosen uninventoried weapon, as long as you never switch to another gun. What's neat is that you can pause, switch to a gadget, such as the covert modem, then either use that, or press your weapon switch button, and you'll be back to the temporary weapon! Despite the fact that the pause menu says you are "Unarmed", you can still end the mission with a temporary weapon listed as your weapon of choice.
For more amusement, play around with the Max Ammo PBC, so you can have fun with other stuff, like the Shotgun, Throwing Knives, or even those strange empty weapons you pick up in Depot. If you throw knives against a wall, then disable All Guns, you can then pick them up, and they permanently remain in your inventory, regardless of how many times you toggle All Guns.
Will any of this info be useful in a speedrun? Probably not by itself yet, but it at least provides a little more insight in the way the game handles your weapon/gadget list when your inventory suddenly undergoes a huge change.