This is an interesting thread and I have a lot to say about this subject.
I have insomnia and enjoy whatsapping in the middle of the night. I only text people who live in different time zones or who have shown themselves to be receptive to night texting by contacting me at unreasonable hours first. Equally if people used to text me a lot at night but now stop I stop texting them in the night as I assume they no longer want to receive texts at this time. People I text at night include close friends, my sister and one colleague who I enjoy bitching with. For me texting at this time portrays a certain level of intimacy. I don't expect the people I text to reply immediately nor do they expect an immediate reply from me. I have my phone on silent at night (and as far as I'm concerned since my dad died anyone who's having an emergency can call 999 not me). Practically speaking, DP has phone on sound all night anyway, so people would be able to contact us. DP is the opposite of me and does not like receiving night texts. I attribute our opposite approach to phone usage to the slight age difference, it causes a little conflict in our relationship, specifically at night (she thinks it should be used to make phone calls and has the sound on at all times, I use mine like a giant pager for text only communication and internet browsing, the only people I call are DP and my mum. She wants me to put my phone away after 11pm, I want her to stop making phone calls after 8pm and text them instead as I consider it to be rude to call people in the evening and want attention myself 👸. For me I don't like phone calls, I find them an intrusion, and I never answer my phone so people rarely call me. DP always answers her phone and hates texting so receives many calls, she calls close friends at any time up to 11pm which I consider rude, she considers my habit of texting in the middle of the night to be ruder. She's 40 and I'm 35).
People I don't text at night include friends I'm less close to, and any other colleagues whose personal numbers I have, irrespective of whether they text me at night or not, this is because I want to create distance. I have one colleague who has often whatsapped me at silly times like 5am but I always wait until at least 7am to reply. It doesn't bother me enough to actually talk about with with her because my phone is on silent, but equally I don't want to appear like I'm on call to her because she's actually demanding enough at work. My work phone goes off when I'm out of the office and the only colleagues whose personal numbers I have are peers, not boss or juniors.
I don't really give out my number much, so I'd text most people who have my personal number between 7am and 10pm, except my mum who is not a morning person and doesn't want to receive texts between 2am and 10am. There's a few people like my brother I may text until midnight, but I know he doesn't like to receive texts in the middle of the night.
Tl;dr: basically I think that anyone you know well enough to give your personal number to should be someone whose habits you know well enough to know whether it is appropriate to text them at night or not. Generally I find older people prefer not to text.