The stereo sounds like it's been wired incorrectly, the way most numpties end up doing it. Apologies if you wired it!

there are usually two live feeds required for a modern stereo, 1 which is connected to an ignition live so the stereo turns on and off with the key, the other should be constant from the battery to keep the memory going when the ignition is off.
My guess is that the two lives for the stereo are wired together and to ignition only.... with it being temperamental I would be concerned there is something else up with the way this has been wired too. It may not be getting enough power to run properly either, pull it out, check the condition of the wiring, check the source of it's earth while you're at it.
Immobiliser.... Hmmmm, feck knows. But mine did this! Check my project thread!

Before I even try and suggest what it might be, do you know if this was fitted by a pro or the last owner, neither means it would be a good job by the way as mine was originally done by a pro.... ha!
Again this sounds like a power issue, you try to start the car, at this point the immobiliser power may be weak or non existent thus causing it to reset....
After a harsh change of climate, is your battery OK by the way?