My DS 7 has this issue too. He wet himself twice at school one day because he did not want to go to the bathroom by himself. He has been going to therapy which he loves - he asked if he can keep going even when he is not scared to be alone. It actually has gotten better over the last several months and he is starting to go to the bathroom, get up, etc. by himself. He stays in his room at night but he has to have the covers completely over his head. Today was the first day that he has ever gotten out of the bed by himself and come out to the kitchen where I was.
The therapy has been really eye opening for me because in the first session where we talked about how long he has been scared - he said it started when he was about 4. When he was 4, I realized 1) we moved to a different city; 2) my husband had a kidney transplant; 3) my DS broke his femur and was in a full body cast for 10 weeks and 4) I got diagnosed with a genetic heart condition. He is resilent, but maybe that was a lot for a 4 year old and added to his lingering fear of being alone.
I think therapy is a great idea. My son does play therapy and loves it.