It happens a lot to me too.
What I usually do though, I just move my homunc away from the monsters and potion pitch manually. Before, I would relog and make my character idle and potion pitcher in MirAi would work fine until I stop idling it to feed my homunc.
It's weird how when you want it to work, it doesn't ;(