How much assist were you using, and did you shift under power? If you're going to ride up something super steep but decide to shift at the last minute, and you're using a ton of assist, that's your worst case scenario.
It's just like a normal bike, but with way more power. As such, you need to plan your shifts a little better.
Could also just be bad luck. Chains break sometimes.