It’s comforting for her because she feels snug and safe in there, and scared and insecure when taken out.
But.. you can train her to feel secure in new ways:) At this age, I used the zip up swaddles which were a lot more snug. Also, if baby felt scared, I comforted her in other ways. Then I trained her to sleep on a bed. It was tough for everyone at first, but she later slept like a champ! And she’s been sleeping alone in her cot since. We also trained her to fall asleep on her own.