You set up an old Redmi, POCO or Xiaomi phone as a camera. It is on the charger, the screen is off, the camera app is recording. Later you check it, and the recording stopped long ago. There is no error. The app has simply been closed, or it opens fresh as if it was never running.
On these phones this is usually not a broken phone and not a broken app. It is the phone's own battery and "cleaning" system, which is built to close apps you are not looking at. A camera with the screen off is exactly that kind of app.
This guide shows the settings that cause it, where to find them on HyperOS and on older MIUI phones, and how to test your phone in ten minutes.…