It has to be related to the prize powder lua. When it buys, the item list is not actually filling with items. Its buying and selling without populating the inventory causing an npc glitch? Or something like that?
The server is very slow to update your inventory, so what's happening here is:
You buy 80 stacks instantaneously, server starts talking.
Server says your inventory is being updated and tells client not to display it until it's finished updating.
Server says you have 1 stack in slot 1.
Server says you have 2 stacks in slots 1-2.
Server says you have 3 stacks in slots 1-3.
etc.
Server says you have 35 stacks in slots 1-35.
You sell the NPC 80 stacks.
Server continues to update your inventory, fixing inaccuracies from the beginning.
Server says you have 34 stacks in slots 2-35.
Server says you have 33 stacks in slots 3-35.
etc.
Server says you have 0 stacks.
Server finally sees it's told you the current up to date inventory and says to go ahead and display it.
This happens with bellhop, packer, organizer, pretty much anything sending item manipulation packets quickly. You can move 80 items in a single 350ms communication, but it'll take the server up to 10 seconds to tell you they've been moved. The server does keep an accurate list and there's nothing to worry about as long as you aren't trusting the client when you shouldn't be.
tldr; Inventory falling behind isn't related to whatever you're experiencing. I don't have that issue on Ashita with bellhop, it may be something to do with selling out of range of the NPC or the way the packets are sent.