I was swimming in the ocean in survival mode, then I drowned and respawned and changed to creative mode. I equipped a potion of Night Vision (8 min) and a Trident, then teleported to the ocean and tried to drink the potion but it didn't work. The animation and sound worked but it gave no effect. I exited to the title screen and entered the world again which fixed the problem. I've had the problem a couple of times, even without dying but can only remember having teleported before trying to drink the potion.
Did the animation stop on its own or did it keep going until you released your mouse button?