I've never had ammonia do anything like this. Doesn't mean it's not possible though. I don't think his back is broken since he's able to swim and has full range of fin motion. I think it's "fish scoliosis".
This is what I meant.It's a back injury; the gar most likely got spooked and darted into the side of the aquarium. Injuries like this are reasonably common with gars, but can be prevented. They do sometimes recover to some extent, but often the gar will never have a straight back again. I wouldn't worry about it too much as long as it can swim okay and get food just fine; if it gets worse, then you may have to put it down.