(a) Whenever a motion contesting the adoption is filed, the court shall set the matter for a contested hearing to determine:
(1) Whether the best interests of the adoptee will be served by the adoption.
(2) Whether the adoptee is a person capable of being adopted by the petitioner in accordance with the requirements of this chapter.
(3) Whether an actual or implied consent or relinquishment to the adoption is valid.
(4) Whether a consent or relinquishment may be withdrawn.
(b) The court shall give notice of the contested hearing by certified mail to all parties who have appeared before the court. The moving party and each petitioner shall be present at the contested hearing. The guardian ad litem shall appear and represent the interests of the adoptee.
(c) The court may continue the hearing from time to time to permit notice to all parties, or to permit further discovery, observation, investigation, or consideration of any fact or circumstances affecting the granting of the adoption petition. The court may order the investigating officer, appointed under Section 26-10A-19, to investigate the allegations set forth in the motion for a contested hearing or the whereabouts of any person entitled to notice of the proceeding.
(d) After hearing evidence at a contested hearing, the court shall dismiss the adoption proceeding if the court finds:
(1) That the adoption is not in the best interests of the adoptee.
(2) That a petitioner is not capable of adopting the adoptee.
(3) That a necessary consent cannot be obtained or is invalid.
(4) That a necessary consent may be withdrawn. Otherwise the court shall deny the motion of the contesting party.
(e) On motion of either party or of the court, a contested adoption hearing may be transferred to the court having jurisdiction over juvenile matters.
(f) All references to the names of the parties in the proceedings shall be by initial only.
(g) Where the contested hearing is held in the probate court the judge may, upon completion of the contested hearing, immediately proceed with the dispositional hearing as provided in Section 26-10A-25.
(h) Where there is a contested case hearing, if the adoption is denied, then the probate court or court of competent jurisdiction, unless just cause is shown otherwise by the contestant, shall issue an order for reimbursement to the petitioner or petitioners for adoption for all medical and living expenses incidental to the care and well-being of the minor child for the time the child resided with the petitioner or petitioners for adoption.
(i) Where there is a contested hearing and the contest fails, then the probate court or court of competent jurisdiction, unless just cause is shown otherwise by the contestant, shall issue an order for reimbursement to the petitioner or petitioners for adoption for all legal costs incurred which are incidental to the contest.