This does not occur in 1.21.3 and 24w46a.
Steps to reproduce:
Go to the underwater in survival mode and wait until empty state of air bubble icon appears
Run /effect give @p water_breathing 10
Expected result: The oxygen bar stops decreasing and retains its state.
Observed result: The oxygen is regenerated immediately.
This is likely consistent with Bedrock, but the oxygen regeneration speed is rather fast.