No one has thought of the obvious solution (actually, one person kind of got there) in that the battery might be faulty, and either the power generated by it just stops for some reason, or it isn't making a proper connection to the, err, battery wotsits inside the machine. I'm sure you know what I mean
This is especially true if it never happens while plugged in to the mains.
In my experience, an overheat situation will either freeze the machine, or cause a spontaneous reboot. It's never just turned off.