I agree with above, it is very important to find out what happened with him before getting another one.
You only mentioned ammonia and ph with testing the water, what were nitrites and nitrates? I have a feeling your tank may not of been cycled seeing any kind of ammonia reading.
Nitrites can be lethal and very stressful on your axie as well, i have seen my tank with 0ammonia and off the charts nitrite in a cycling tank, if this was the care he could of been blindly poisoned by the toxins. It is very important to test all 4 levels frequently.
Your axie looked skinny but it also looked like he had chemical burns, i also agree it looked like he was trying to morph. However sometimes a axolotl will go through phenotypic plasticity when it is a live or die situation(leave the water and potentially die morphing, or dont do anything and still be in this situation) also high levels in your water will also cause a lack in appetite, and gill shrinkage.
I wish i had seen this sooner
i would of told you ANY time you see something like this in an axolotl, remove them from the tank immediately, put in a tub of fresh dechlorinated water and do 100% water changes daily. In thiscase where impaction could of been a factor, i would also recommend getting the water around 10-15C though this is normally difficult to do outside of a fridge, to wrap a towel around the tub and keep a close eye on the temp, keep feeding it earthworms and hopefuly the stones would regurgitate.
If you do decide to get another axolotl please remember this tip! Remove the gravel too as if we can remove gravel from a factor to why it is sick 99% of the time it is water quality, though the quicker you can remove them the better chance they will survive, and the only time i recommend fridging of a skinny lotl that wont eat is if impaction is suspected or if bacterial or viral infection is suspected and you are waiting to get them into the vet.
I am so sorry for your lose and If you still have the tank running if you could test the nitrite and nitrates it would be helpful!