Ya that's exactly the reason, it's bcs the inventory container isn't refreshed yet... but this also happends in the middle of a botting session... Whenever the inventory fails to update due to some cpu spike or whatever.
it won't detect any items and will tell my scripts there is no stuff left, that's why I don't liek this kind of options in a script.