I have several serious sleep issues including insomnia (not usually due to racing thoughts, just inability to sleep) and circadian issues. What you are describing sounds like what I call "half sleeping", although I can always move if I try (I'll also usually unintentionally wake myself up rather quickly when lucid dreaming and can then move almost immediately; I definitely do not have sleep paralysis, although possibly it is similar but not being able to move). This happens to me quite a lot, maybe even almost daily (sometimes multiple times). I think at least some cases of "day dreaming" are a similar state as well.

Both going to sleep and waking up I often notice this state; when going to sleep, I'll either stay that way long enough to actually get to sleep (usually only a few minutes I think, possibly 15-30 minutes at most on rare occasions) or unfortunately I often unintentionally wake myself up from that state (on those occasions it feels a bit like I have a fear of sleep). After I have slept for a while I am more commonly in that state for 15-30 minutes at a time and maybe sometimes longer, it is hard to remember (total time a day can be longer but I will fully wake up or sleep for a while in between). My memory for sleep related stuff is likely much better than most people due to the decades of insomnia, however it still isn't that good (nor is my memory in general after so much sleep trouble). I think my sense of time is fairly accurate in that state and it is often how I decide to consider it half sleeping or sleeping for my sleep log (I'll often look at a clock before it happens and if the next time I look at the clock it is a fair amount later than I expect then I was likely sleeping, although sometimes when near sleep I've looked at the clock and clearly seen a different time than it actually is so that might be the issue at times as well; the clock thing is not just lucid dreaming since it often happens when I'm standing up on the way to the bathroom). My understanding is the way sleep is defined it is possible at times to maintain awareness between being awake and in light non-REM sleep so I am also not 100% sure that "half sleeping" isn't technically sleep.

My understanding based partly on looking at some research (although I'm hazy in my memory at the moment so definitely look into any particular point if interested with the idea that I might be remembering incorrectly) is that there are a number of independent processes that are usually orchestrated fairly well into what we call sleep. There are a few parts of the brain that coordinate sleep and circadian rhythm, including a part of the hypothalamus. IIRC what we consider to be falling asleep may be closely connected to a state of the thalamus that is exclusive with being awake, but other parts of the brain can indepenently be more like being awake or more like the various non-REM sleep stages. This can happen the opposite way as well with "microsleep". When particularly sleep deprived I'll often involuntarily nod my head down a bit and microsleep in what feels like much of my brain while generally still aware of my surroundings. I think microsleeps may also cause the loss of working memory at times when sleep deprived and various other short term oddities. REM sleep is a different thing entirely with movement inhibition based in the brain stem and where the brain is otherwise mostly in its awake state. While dreaming is more common in REM sleep it is yet another independent mechanism that seems related to dopamine. The memory changes with sleep might be yet another usually connected but distinct mechanism. Sleep also isn't just neurally activated but there are a variety of endogenous sleep promoting and wake promoting substances. So definitely more complicated and messy than we usually think of it with a collection of sometimes mutually exclusive states none of which fully correspond with what we consider to be sleeping.