The water and lava "level" blockstate is reversed when identifying them using commands.
- Place a water source
- Stand inside the water block next to the source
- Run the following command: execute if block ~ ~ ~ water[level=7]
If done correctly, this command should fail. If identified through the debug ui however, the information correctly shows that the water level is in fact 7. Now repeat the steps listed above but stand at the last water block flowing out of the source. If done correctly, the command should succeed.