Does this fan also have a wall switch?
E.G the wall switch is left to “ON” although the remote has turned it off prior to losing power.
If not I would install a wall switch to provide power to the entire fan. When you go to bed, turn the wall switch OFF. The fan cannot be turned on unless the wall switch is ON. This would eliminate the problem as the fan can’t get power when the wall switch is OFF, at all.
This would probably be a simple solution. Otherwise you can have an electrician in to look at the issue. I wonder if the wiring was done wrong so its default state is ON if that makes any sense. In either case you need an electrician so I would call one, explain the situation and see what they recommend.