When the potion drinking animation ends quickly switching to another slot on the hotbar that has another potion results in both potions getting consumed, only giving the first potion's effect.
Environment
Minecraft Vanilla 1.20.4 - Singleplayer
Arch: Intel i5-12400
Alloc Mem: 2320MB
Windows 11
Java Version 17.0.8 64bit
Duplicate of MC-198453, only 1 potion is truly consumed.