Miltanks can typically give 1-2 pails of milk before yielding a glitched bucket of milk. There doesn't seem to be any special way to trigger this, just milking Miltank more than a few times can yield a bucket of Milk that will empty if you try to craft with it. For what ever reason, taking it out of your hotbar and moving it to your inventory or crafting table removes the milk inside and leaves you with an empty pail. After this occurs it usually persists for a few Minecraft days or if the player waits a while and logs out and back in. This hiccup forces the player to catch multiple Miltank for crafting Potions or Cakes.