I am of the opinion it is perfectly acceptable for someone to text me at 3 am. At 3 am I am usually asleep, and even if I am awake, I would not be inclined to text anyone at that hour.
When I am about to sleep, I sometimes turn my phone setting to mute. Usually, I just sleep through whatever message alert sounds that my phone makes.
I view a text message as something of tertiary importance. If something is very important and/or sensitive and/or critical, they would probably come see me personally to convey the message. For example, if there is a casualty involving a family member of mine in a motor vehicle accident, the police would usually come convey the message to me personally.
If people have something to convey to me but they cannot come to tell me personally, they would make a telephone call. This makes telephone calls to be of secondary importance. If my friend wants to offload something in his heart, he would probably call me to moan over it. If I need an ambulance or some important service but I cannot go there for that service, I will make a call. I would not send a text.
This puts texts into a position of tertiary importance. If someone sends me a text, I do not feel obliged to look at it immediately, or to respond immediately. If the sender expects me to read and respond immediately, I feel something is wrong with the sender's perception of a text message. If it requires an immediate response, the sender should have given me a call, not send a text message.
So sending me a text message at 3 am is not rude. Instead, expecting me to respond to a text message immediately - regardless of time - is downright offensive. That's my opinion.