Is it normal to pretend people are there when they aren’t?

Please don’t judge me. I pretend that people are there when I’m alone. I know that they are not there and I don’t believe that they are real.

I would consider myself a lonely person (which I am working on), and I’m diagnosed with anxiety and possibly depression, If that’s relevant?

I kinda just play scenarios, or conversations in my head, and sometimes when I’m laying in bed I pretend there is someone else, to cuddle.

These “people” are a comfort to me. My mental symptoms get A LOT worse at night (one of the only times I’m alone), so these people comfort me when I have no one else and need support. Is this normal? Has anyone else experienced this or has even heard of this? Please I just need to know because I cant stop asking myself if it’s normal or not.