This could be a slightly lifted battery connection, faulty battery, faulty logic board or something abnormal with the software. Either way your best bet is likely just getting a swap with Apple if you have that option. If you do not, try a reputable repair shop.