In general, neither of the two cases should happen, but in exceptional cases this can occur with night videos or pictures at night when the batteries are no longer full. You can see the status of the batteries in the last recordings of the camera or in the app/camera control.
The reason for this behaviour in both cases is that the battery voltage is too low. Since night pictures draw more than 1A (ampere - unit of amperage) because of the strong infrared LED illumination, the photo release may be aborted if the batteries are bad and/or almost empty.
If you use AA batteries, then this problem is exacerbated by the lower output voltage.