Question about if my boss is in the right or wrong

I'm not trying to make a big deal out of this I'm just curious. I'm pretty sure I've had anxiety for about a year or longer now. I'm 18 and I finally got enough courage to get up and get a job despite how I was so scared even applying at places. I work at an assisted living facility. This last weekend I've had a lot of things going on, my car broke down, I'm super tight on money fixing the car, I had to pay bills, I currently have to pay for two extra people in the house because my boyfriends mom is letting them stay here, they pee all over my bathroom and don't clean up after thier selves. Me and my boyfriend haven't been agreeing with a lot & I keep having very realistic dreams about my ex boyfriend that passed away being alive again. This is all that's been going through my head making my anxiety and causing breakdowns the last two nights. I've gotten maybe 2 hours of sleep, so last night I text one boss saying I won't be in today unless they have literally no one else to do the job. I woke up with no text back. (We always text instead of call in, that's just how they have always done it) so I text again and then nothing. So I fall asleep finally and about 6:45 my other boss calls asking where I was. I explained that I texted the first one and said I won't be coming in for a personal reason. He made me come anyways. I go in and ask to get off early because at this point I'm so exhausted. He then starts asking what my personal reason is. I told him I did not want to talk about it. He keeps pushing and asking and I told him I wasn't going to talk about it with tears running down my face and walking away saying I need to use the restroom. Then he tells me if I leave early I need to bring a drs note in tomorrow. I don't want to go to the hospital on a Sunday for anxiety. I do need to go to the drs but I can't do that right away. I'm just asking if he is in the right by pushing me asking me what the personal reason is and telling me I now have to have a drs note when I come in tomorrow just because I wouldn't tell him what's wrong. I'm sorry this is so long.