Parenting an object does not parent but has broken or dashed lines when I am trying o parent some objects instead of the expected behaviour I get broken lines in the outliner, and they look like a duplicate.

In this picture, you can see the Nissan_logo_Rear is showing dashed lines, and the actual object is outside the hierarchy.

How can I fix this?
OK, so it was because the logo objects were not part of the collection that the parent object belonged to.