When you try to put an item like a healing pill to your Hotbar(left click drag) and at the same time Auto Pill heals you, you will get disconnected. Same happens when you put or take stuff from Pet inventory (Its a pretty old bug tbh)