Hello, there should be detection for vials in your inventory after your done drinking a stamina potion.
Check if you have vial smasher enabled ( or if there is a vial in your inventory in general without doing the extra action without a reason )
Because after the script consumes a Stamina potion (1) Dose it is trying to deposit the inventory when there is nothing inside it.
Other then that the script looks great