(a)
Whenever the petitioners move to withdraw the petition for the adoption or to dismiss the proceeding, the clerk of the court in which the proceeding is pending shall immediately notify the department at Sacramento of the action. The department or the delegated county adoption agency shall file a full report with the court recommending a suitable plan for the child in every case where the petitioners move to withdraw the petition for the adoption or where the department or delegated county adoption agency recommends that the petition for adoption be denied and shall appear before the court for the purpose of representing the child.
(b)
Notwithstanding the withdrawal or dismissal of the petition, the court may retain jurisdiction over the child for the purposes of making any order for the child’s custody that the court deems to be in the child’s best interest.
(c)
If a birth parent who did not place a child for adoption as specified in Section 8801.3 has refused to give the required consent, or a birth parent revokes consent as specified in Section 8814.5, the child shall be restored to the care and custody of the birth parent or parents, unless the court orders otherwise, subject to Section 3041.