There is a widespread problem with a large number of Xiaomi models. The processor is dying. But you need to be sure about that. You have to charge the battery separately from the device. Try to update/renew firmware. It will make the situation clearer what the problem is, and what we should do next.