very likely a nerve injury of some sort. i have seen this before in many gars (various species) over time, but usually not this frequent in occurrence. it's tough to say as this fish seems to recover every time. i have had gars hit the glass, convulse like this and die, i've had some bounce back, and i had a pair of Cubans that did this for a couple days and then seemed to go back to normal.
with your fish, especially since it is young, there may be a better chance for survival. if it is still happening, i would suggest putting it into a tank by itself or just with other gars. just use a sponge filter or something a little less disruptive than a power filter and hopefully in time (with good feeding/water Q) it will heal up and go back to normal consistently.
how long has this been happening? as long as the fish is eating and snapping out of it, i would say it's worth working with it to potentially remedy the condition. apologies for the late response, i've been very busy with work. i think it may be possible to cure the gar though--
--solomon