Your liver runs on circadian rhythms - it is meant to be in tune with you being up at sunrise and going to bed at sunset (or close to there). This article talks about that some: https://worldhealth.net/news/liver-grows-half-during-day-shrinks-night/ 21
I have been in ketosis for 3 years. I too wake at 3am. Here is why: 3am is when your liver regenerates. To do so, it needs glycogen. Once keto fat adapted, your liver no longer stores glycogen, so you body will not have enough glycogen for the liver to regenerate at 3am. If your liver cannot get the glycogen it needs, your adrenal glands will compensate by releasing adrenalin, which is why you are wide awake and ready for action, not exactly a state you want to be in at 3am.