Such deep lapses of the awareness happen because of tension. If you try to keep awareness moment to moment, the longer you do it and the harder you try, the more dramatic lapse will happen. I recall when I tried to keep stable tight grip of awareness, eventually I discovered myself floating among dream-like images.
Perhaps the same mechanism worked in your case: your mind eventually got tired, and its attention started to wander - that's a way to give the brain some rest.
Apart from that, I don't know, are there any pathological processes involved in your case or not.
Another point: with meditative practice people develop such strong concentration that the perception of time and place might disappear. For example, you meditate or do some other calm, meditative things, and suddenly you discover that much time has passed. I recall once when I painted my self-portrait and finally got more or less satisfied, I stretched my back, looked around and wondered, why the light was on. It was not dark yet. So why did I turn on the light? I went to the kitchen to look at the clock. It was almost half past ten. So it was late, then why it was not dark outside? I looked out of the window. Was there a nuclear war, a comet falling or something? Why the sky was bright? But people walked down the street quite calmly, as if nothing unusual was happening. So gradually I realized that it was morning already.
Such experience might be called samadhi - deep meditative absorption. A practitioner is so immersed in his activity - sitting meditation or something else - that doing it he might not notice that several days passed. There is a story of some practitioner who lived secluded in mountains. He boiled himself some porridge, but before eating he decided to meditate a bit. Soon shepherds came and asked why he didn't visit their village for some time. He didn't realize that several days had passed, but when he opened his pot of porridge, he saw there long strands of mold.
When the control over our actions is lost, it's probably not samadhi, but mental wandering. However that wandering had deep concentration, that's why the awareness was lost so completely. The moment of losing control likely happened because the brain got tired of tension.
That's a basic explanation which I can think of. Not sure, is your brain in good health or not, such tension can be not a very healthy sign, though not necessarily. In any case, take a good care. Investigate: which habits create the excessive tension in your body-and-mind? What are the causes? Change those causes in your life and abandon those unhealthy habits.
Direct your practice at developing more openness and relaxation.
Don't grasp meditation so tightly. Rather, let it be relaxed. It' like putting an object down, rather than squeezing it in your hands.
When it lies on the ground, it won't run anywhere, so relax and let it stay. Let yourself stay, relaxed and unconstrained.
Even if your mind starts to wander, it's better to follow that wandering and remain aware, rather than struggling with it and eventually losing the awareness at all.
The ultimate mastery in meditation is effortless.
Good health to you!