This is a great question.
Note: I cannot answer this question for all jurisdictions, but I can answer it as it applies in the jurisdiction where I practice divorce and family law (Utah).
First, I do not know the definitive answer to your question based upon the knowledge I’ve accumulated as a divorce and family lawyer for the past 26 years. In researching the question, here is what I found:
If a court in a termination of parental rights proceeding determines that both parents are unfit and thus that custody of the child(ren) should not and cannot be awarded to either parent, then it appears to me that Utah Code Title 80 (Utah Juvenile Code), Chapter 4 (Termination and Restoration of Parental Rights), Part 3 (Termination and Post-termination of Parental Rights), Section 305 (Court disposition of child upon termination of parental rights—Posttermination reunification):
80-4-305. Court disposition of child upon termination of parental rights — Posttermination reunification.
(1) Except as provided in Subsection (7), as used in this section, “relative” means:
(a) an adult who is a grandparent, great-grandparent, aunt, great aunt, uncle, great uncle, brother-in-law, sister-in-law, stepparent, first cousin, sibling, or stepsibling of a child; and
(b) in the case of a child who is an Indian child, an extended family member as defined in the Indian Child Welfare Act, 25 U.S.C. Sec. 1903.
(2) Upon entry of an order under this chapter, the juvenile court may:
(a) place the child in the legal custody and guardianship of a child-placing agency or the division for adoption; or
(b) make any other disposition of the child authorized under Section 80-3-405.
(3) Subject to Subsections (4) and (6), the division shall place all adoptable children placed in the custody of the division for adoption.
(4) If the parental rights of all parents of an adoptable child placed in the custody of the division are terminated and a suitable adoptive placement is not already available, the juvenile court:
(a) shall determine whether there is a relative who desires to adopt the child;
(b) may order the division to conduct a reasonable search to determine whether there is a relative who is willing to adopt the child; and
(c) shall, if a relative desires to adopt the child:
(i) make a specific finding regarding the fitness of the relative to adopt the child; and
(ii) place the child for adoption with the relative unless the juvenile court finds that adoption by the relative is not in the best interest of the child.
(5) If an individual who is not a relative of the child desires to adopt the child, the juvenile court shall, before entering an order for adoption of the child, determine whether due weight was given to the relative’s preferential consideration under Subsection 80-3-302(7)(a)(i).
(6) This section does not guarantee that a relative will be permitted to adopt the child.
(7) A parent whose rights are terminated under this chapter, or a relative of the child, as defined by Section 80-3-102, may petition for guardianship of the child if:
(i) following an adoptive placement, the child’s adoptive parent returns the child to the custody of the division; or
(ii) the child is in the custody of the division for one year following the day on which the parent’s rights were terminated, and no permanent placement has been found or is likely to be found; and
(b) reunification with the child’s parent, or guardianship by the child’s relative, is in the best interest of the child.
Utah Family Law, LC | divorceutah.com | 801-466-9277
(28) Eric Johnson’s answer to What happens in a custody case when both parents are proven unfit? – Quora