Right, what happened was you ran out of thrust because your commanded climb-rate was too high for the altitude (wrong AP mode). This leads to high AoA, which leads to more drag, IAS decreases and you end in a stall.
The higher you fly and closer to max altitude for the current weight, the less margin you have for airspeed to drop and you just don't have the thrust to recover. A bit like AF447.