When switching to another item that you can drink while drinking, the character will drink the first one and the second one will disappear.
Related issues
is duplicated by
Comments

Thank you for your report!
We're actually already tracking this issue in MC-159429, so I resolved and linked this ticket as a duplicate.
If you would like to add a vote and any extra information to the main ticket it would be appreciated.
If you haven't already, you might like to make use of the search feature in the future to see if the issue has already been reported.
Scratch what I said above, this is actually a different issue.
Can confirm as well. Tricky to reproduce. The most easy way is to drink a water bottle and switch to another one while drinking. But I was able to reproduce with switching to non-consumables as well, though that is more difficult to time.
Can confirm.