Unfortunately, the legal system has long received bad advice on this subject from some mental health professionals. Many psychologists who ought to know better will still say that it is ideal for a child to have a primary attachment figure and to be separated from that primary attachment figure only briefly until sufficient language skills have developed to allow the child to fully understand what is happening and that they will be reunited with their primary attachment figure after a more substantial visit with the secondary attachment figure. This is thought to foster healthy infant attachment, which we all agree is a predictor of psychological health at least later in childhood and possibly throughout life. Following this train of thought, secondary attachment figures in families of divorce (often fathers) would be limited to visitation of a few hours at a time for at least the first few years of a child's life. Since the secondary attachment figure would like to have intimate parent-child interactions, they would ideally visit the primary attachment figure's home and participate in rituals such as bathing or bedtime. In reality, of course, many divorced couples do not get along well enough for this to occur, and primary attachment figures often work or leave young children with extended family members for overnight visits even as the try to refuse such visitation to the other parent in contentious divorce cases. Attachment theory can thus become a weapon in family court that is used to estrange secondary attachment figures (again, often fathers) from their children during the early years of a child's life. This may impede the development of parent-child bonding, and there is a significant body of literature supporting the importance of involvement by both parents to positive developmental outcomes. More importantly, perhaps, this interpretation of attachment theory is not at all accurate.
John Bowlby, considered the father of modern attachment theory, did originally suggest the idea of monotropy (that the only significant infant attachment is to a single primary caregiver). However, Bowlby himself later softened on this idea, and both common sense and literature in the field of attachment now acknowledge that children are capable of multiple attachments even very early in life. In fact, the more positive attachments a child has, the better the implications for future psychological health and well-being. Further, the research is clear that the long-term involvement of both parents in a child's life leads to the best outcomes. The primary consideration in early overnight visitation should be the quality of the relationship between parent and child, not the age of the child. Unfortunately, some mental health experts continue to provide the courts with inaccurate information that perpetuates myths, to the detriment of those deemed secondary attachment figures and the children themselves.
Update: On 2/5/2020, Dr. Clifton Hudson and Dr. Jennifer Price, formerly of Hudson Forensic and currently Assistant Professor in the Marshall University Department of Psychiatry and Behavioral Medicine and President of the West Virginia Psychological Association, addressed the West Virginia Legislature's House Committee on Senior, Children, and Family Issues on the modern social science literature pertaining to attachment and early shared parenting.