Reproduce: Go into gamemode 1, walk to a block with auto jump on, at the maximum height of the automatic jump press the jump key.
Result: Flight.
I'm pretty sure the only intended ways to activate flight is to press the jump button twice and going into gamemode 3 (and back to 1).
It is pretty annoying and probably not intended, but I'm guessing the game calculates when you're walking against a block and executes the jump action, and when the jump action happens twice you fly, so it's not that much of a 'bug' but more an unintended feature.