I used to have a camera which had a tendency to switch itself off rather too readily. (It seemed to think that the batteries were dead after just one or two shots). This happened with both rechargeable batteries and regular Duracell-type (i.e. alkaline) batteries. Switching to Lithium batteries produced a dramatic improvement. (Instead of one or two shots, I was getting several hundred). This might not be the same problem as you're having but it could be worth a try.
(Also, if you're using rechargeable cells, remember than they don't last forever. If one, or more, of the cells has started to fail, this could be the cause of your problem).
Chris