This will sound silly, but I suffer separation anxiety when my boyfriend falls asleep
It sounds a little drastic. Why do you suffer from separation anxiety when just because your boyfriend falls asleep?
I miss him when he is sleeping
Your behavior is exhibiting co dependence and this is not healthy. You need to be more independent and not rely on your boyfriend so much. It is best to rely on yourself.
Wtf are you talking about it's not possible to avoid the anxiety
You can certainly learn to avoid it. If you're struggling with overcoming the anxiety, then a mental health professional could probably help you.