This is clearly a stress / anxiety related problem and any kind of scolding or yelling is only going to make it worse.
Urinating is a dogs natural response to very exciting or very stressful situations. Puppies often urinate when they are too excited to see someone, adults do it for example to show submission and deescalate a fight.
You already identified 2 triggers (going to bed and leaving the house) that stress your dog so much she starts peeing even though she just did her buisness outside and she knows it's inappropriate. That's why she drinks the urine after, to remove the evidence. If you yell at her in such situations, you only increase the stress and make her feel even worse, because now she learns that your going to bed not only causes her fear, but also makes you yell.
First of all you should wash her bedding very thoroughly, even with an enzype cleaner if possible. That removes the smell of urine that triggers her to pee in that spot over and over again.
Next you could try 2 potty breaks before going to bed. One at the regular time you always go, and then another just before she usually pees in her bed. Praise her very much (with words and/or a treat) if she pees again during the 2nd break.
Potty pads are a good idea to contain the mess, but they just treat the symptom, not the cause.
The cause is the anxiety and insecurity of your dog and treating that is a very hard and long process. A mild medication can definitely help, but will not be the cure alone. I suggest you use the service of a professiona dog trainer. Make sure they are competent to work with anxiety problems and not just a personal puppy school.
Here's a list of articles that hopefully help you treat your dogs seperation anxiety:
Separation Anxiety Solution by CattleDog Publishing
Here’s the Only Real Way to Train a Dog with Separation Anxiety by The Dog People
Dealing With Dog Separation Anxiety by cesarsway
Try different approaches and see what your dog reacts best to.