(i) If a petition alleging the child to be in need of protection or services is filed under this paragraph, the court may find, based on the contents of the sworn petition, and the agreement of all parties, including the child, where appropriate, that there are compelling reasons that the voluntary arrangement is in the best interests of the child and that the responsible social services agency ha