Run “/loot give @a loot bug:consumable“ and just do right-click a single time with the consumable item and and you will see how the command starts to run repeatedly in a random loop. To easily exit this loop, hold down the “ESC” key, and you will notice how the bug:use function continues to run even though you are not actually pressing the right click.
The loop runs randomly, but in the chat you will see “show dialog” multiple times when it should only say it once. In this video, I have to press ESC multiple times to exit, even though I'm not pressing the right click.