Except as provided under s. 48.839(3) (b), if the petition is withdrawn or denied, the circuit court shall order the case transferred to the court assigned to exercise jurisdiction under this chapter and ch. 938 for appropriate action, except that if parental rights have been terminated and the guardian of the minor is the department, a licensed child welfare agency or a county department under s. 48.57(1) (e) or (hm), the minor shall remain in the legal custody of the guardian.
Wis. Stat. § 48.95