The textbook argues that children with a secure attachment are more likely to show positive emotions and have positive relationships with others. Another influence that may affect the outcome of a child's social interactions is the environment. The child can be cared for and developed a secure attachment for its caretaker, but if they enviroment poses as a negative influence, then the future social life of the child is bound to be shaped by that.
I agree with your view. I mentioned that other factors like heredity and the environment might play important roles in the outcome of the child's well-being too. The caregiver might be constantly giving care and attention and this can lead to a secure attachement. But the child's furture development is vulnerable to the complex environment that he/she grows up in too and this environment extends beyond his/her home to school, friends etc. Bad external influence can sometimes sadly offset or unravel all the work that the parent has established for the child.