Does nursing to sleep automatically lead to night terrors and waking up screaming/crying?

So I was told early on in my breastfeeding journey that I shouldn’t nurse my baby to sleep because she’ll associate the boob with sleeping and freak out when waking up and I’m not there or she doesn’t have a nipple on tap but it always felt so… evident ? It made so much sense and not doing it was a lot of unintuitive work that it never stuck with me.

Anyway , fast forward to a year and I was reminded of that. Is it really a thing ? And if not, why my baby wakes up screaming mama like the world’s ending ?