I have found a bug that suggests this issue could be due to a combination of mouse and keyboard input. For example pasting the code in via the mouse and clicking enter on the keyboard.
Using Application Insights should verify this, or at least help you diagnose the issue.