I don’t think that it’s something that can be debugged from videos or even screenshots of events. Generally, more events means it takes more effort to get familiar with what you’re doing before even being able to debug it.
Since it sounds like it’s become complex and is hard to debug you could rewrite it from scratch after working out on paper exactly what you want it to do. Then just do a bunch of tests to verify it’s working as expected as you actually add the events. That’s my usual strategy when making stuff.
Or you could outline how you want it to work and I’m sure there are lots of users that would give suggestions or examples how they would do it.
Personally I’d make such an inventory with sprites instead of arrays. I’d make two sprites: slot and item. Then I’d place instances of the slot sprite all over and place items on top of them. You could indicate if slots are occupied or not and the number of items with some instance variables.
Then with minimal events you could place items into slots, or swap out the item you’re holding with the one in the slot. But ultimately it’s up to you how you want to go about it.