***Cheapo after market batt***eri***es do this a lot.***
If its one of those cheap Amazon batteries with the gold and brown star sticker on it saying 'Good Quality' you are in for a treat. It's usually the phone not reading the batteries percentage properly as there is a communication error between the phone and the battery. Also, if the battery has not been re-programmed to have the same IMEI as the old battery to trick the phone into thinking its original that can spark up a few issues too. Oh, and those batteries labeled 'Higher capacity' can cause a few issues in an iPhone too. I wish you luck!