You did astral project and you're somewhat like me - it happens on its own. When I was younger, I would always find myself floating near the ceiling and almost always though I was dying. I had no idea what astral projection was at the time. Later on, I read up on what it was and I wasn't so afraid anymore. Now I can control it when it happens if I find myself in astral and don't want to be there.
You will always go back to your body though. If you are afraid however, as I know it is one thing to say you won't be afraid and then something else altogether when it is actually happening, do a protection circle before you sleep. Inbox me if you want to share some more experiences. It is not often I come across someone who has had an experience very similar to mine.