I have an iPhone 5 that has this issue. ~40% battery and if there's a sudden voltage sag like turning on gps or opening the camera, the phone will immediately shut off. This ended up indeed being a defect, so much so that Apple had a recall: https://www.apple.com/support/iphone5-battery/