Hi Pavin,
I wonder if you have the machine set to automatically turn on and off?
If so, I would try turning that feature off, so the machine no longer tries to detect when you start and stop using it and switch on and off automatically.
I'm suspecting that the mask is maybe coming off at night while you sleep, and the machine then senses this and turns off.
It's curious that you say it remains off for 4-5 hours then comes back on. If you are wearing a mask with a good seal, then the machine turning off would wake you in an abrupt and unpleasant manner (i.e you stop getting any air). Since you didn't mention that, I wonder if the mask comes off, the machine turns off, and you notice it later when you wake up, put the mask back on, and the machine detects it and starts again.
By disabling this feature, you would have to manually turn the machine on and off. But it wouldn't auto shut off in the middle of the night.
That's kind of a shot in the dark, but it is one scenario that might explain the machine's behavior.
Saldus Meigas
p.s. I see in the time between me typing, reviewing, and posting ... Heracles made a similar suggestion in a lot fewer words.