Leaving a boat whilst still being in flight (elytra) or being in the water with flight (elytra) requires relog to use tools
I don't exactly know how to reproduce this glitch but I have had to relog quite a few times to fix the issue. See the gif below to see what's going on.
Edit: It seems to be happening when getting off a boat. 
2020-06-04, 01:12 AM
2020-06-04, 01:24 AM
2020-06-04, 01:24 AM
0
0
-