I think that's a good idea putting a litterbox next to the bed.
Even though behavioral issues are harder to treat, it's not hopeless, but a lot of people aren't patient enough.
When Miss Kitty was 4 years old (14 years ago), she started peeing outside the litterbox. it was behavioral. Since then, she has been on antidepressants. It took a while to find one that was working for her, but I did, and now she has been on fluoxetine (Prozac) for many years, and she's doing great!
Good luck at the vet tomorrow!