sometimes either it is turn on
Do you have any battery optimizing apps installed? If you do, it may be the one turning it off to save battery.