I erased my previous post when I was,able to get back to mamapedia. It was too cruel considering how much difficulty you're having. Your question causes me to once more urge you to get help for your need to be perfect. You're having an incredibly difficult time being a parent and apparently with life in general. And apparently you are rationalizing your fear to make your fear sound reasonable. It is safe to lose sleep at night and still be able to safely care for a baby during the day time.
I suggest you have meltdowns because you are trying too hard to be perfect. Mom's who are able to handle being involved with a sick child usually change their expectations. They changing their priorities. They let things go so they can take care of their child. They may feel guilty for not doing the dishes and still feel OK with who they are.
A meltdown for everyone, is an indication that they need a time out to take care of themself.Gradually you will learn to recognize that you need something before you have a total melt down and you'll still have some meltdowns. It's OK. Parenting is a learning process and no parent ever gets close to perfection.
So, I suggest you sleep in separate rooms. And get help for your anxiety. I think you are a good enough parent and that you care deeply for your baby. If you didn't care you wouldn't be asking questions. Asking questions is good. I bet you are doing just fine and your baby will heal. It's your fear and feeling a failure much of the time that concerns me. You can feel happy! You will gain confidence. That is why I urge you to get psychological help.
My granddaughter has asthma. In the early years she had srydor. When the spaced between her ribs is indented as she breathes. This does indicate extreme difficulty with breathing and requires a trip to the ER.
Knowing what to look for and not seeing it helps me to be less anxious.
Re: doctors and nursing working with inadequate sleep does cause errors because they are chronically without adequate sleep. Losing sleep short term is not so serious. I've worked successfully when I've not slept well. All police officers on graveyard shift have to do that from time to time. A supervisor will send an officer home if they seem unable to be alert enough. That rarely happens. Or in our department, during a graveyard shift an officer can come in to the station for rest during slack times. That also doesn't happen often.