How to make Item Select work?

Idk how to make it work. It keeps showing me this weird bug where it opens an empty window and decreases the wrong item even though the correct item's id is put in. I've tried to fix it by myself but nothing changed.
Select Item is like Show Choices: the player chooses an option. Except instead of selecting from a fixed set of choices, they select from some items in their inventory.

If the Select Item window appears blank, that's because the player does not have any items in that category. E.g. if you tried Select Item: Key Item, but the player has no Key Items.

Select Item will set the value of the variable to the selected item's ID (as seen on the Items tab of the database), or 0 if the player does not choose an item (i.e. cancel).

Here's an example, choosing the correct key to unlock a door:

◆Text:None, Window, Bottom : :This door is locked. ◆Select Item:Input, Key Item ◆Comment:Did the player select an item? ◆If:Input > 0 ◆Comment:Check if they picked the correct item (ID 5) ◆If:Input = 5 ◆Text:None, Window, Bottom : :Unlocked the door! ◆Control Self Switch:A = ON ◆ :Else ◆Text:None, Window, Bottom : :That doesn't work. ◆ :End ◆ :End
Okay, Thanks for the help!

Original thread: https://forums.rpgmakerweb.com/threads/how-to-make-item-select-work.152270/