I have a child with Reactive Attachment Disorder, and we adopt older, special needs kiddos, so I'm well versed in Attachment Disorder and attachment and bonding issues.
The current theory on attachment is that there is not one set formula. For whatever reason, every baby seems to have their own preset point of trauma/pain/inattentive care which will cause them to shut down and stop being receptive to attachment. For some children, absolutely the traumas, treatments, illness, pain, and time out of mom's arms associated with CF and the varied medical ailments and problems that can come in the early years can in fact interfer with attachment with the primary caregiver.
In a mother who is not well versed in attachment, if she doesn't know to combat these risks, she can end up not well attached to her baby. I've assisted a mother with a son with cleft lip and palette who suffered PTSD and attachment issues related to his medical condition and treatment. I've also assisted another mother whose infant suffered from pyloric stenosis and then Dad was the primary caregiver for the first 2 years of her life due to their work situation. That child has RAD, the worst of the attachment spectrum.
In our situation, I'm 100% positive that our son's Hemophilia combined with his early severe neglect and repeated loss of caregivers resulted in his RAD. But, I've strongly suspected from the start that treating his Hemophilia complicated his attachment disorder. And I can tell you that until we got his medical treatment to a point where we were not causing pain and I was personally removed from the treatments entirely, he couldn't even begin to work on healing from the attachment struggles.
If you read Nancy Thomas' information on attachment, she absolutely puts medical conditions requiring lots of treatments on her list of risk factors to developing attachment issues or even Reactive Attachment Disorder. Doesn't happen to every baby, but it can happen to a baby with a medical condition, especially one requiring lots of interventions and treatments and especially of those interventions and treatments are associated with lots of pain.