
234 Cal.App.3d 100 (1991)
285 Cal. Rptr. 570
GUADALUPE A., a Minor, Petitioner,
v.
THE SUPERIOR COURT OF FRESNO COUNTY, Respondent; NITA DAVIS et al., Real Parties in Interest. In re GUADALUPE A., a Person Coming Under the Juvenile Court Law. FRESNO COUNTY DEPARTMENT OF SOCIAL SERVICES, Plaintiff and Respondent,
v.
ROSA F. et al., Defendants and Respondents; GUADALUPE A., a Minor, Appellant.
Docket No. F015112.
Court of Appeals of California, Fifth District.
September 18, 1991.
*103 COUNSEL
Kimball J.P. Sargeant, under appointment by the Court of Appeal, Edward W. Hunt, District Attorney, Susan B. Anderson and Dorothy Q. Jensen, Deputy District Attorneys, for Petitioner and for Appellant.
No appearance for Respondent.
Janine Reagan for Real Parties in Interest.
Max E. Robinson, County Counsel, William F. Mar, Jr., and Howard K. Watkins, Deputy County Counsel, for Plaintiff and Respondent.
Sam W. Speake, under appointment by the Court of Appeal, Jose R. Villarreal, Public Defender, and Nancy Owens-Cierley, Deputy Public Defender, for Defendants and Respondents.
OPINION
FRANSON, J.[*] 

STATEMENT OF THE CASE
Guadalupe A. was born to Rosa F., also known as Rosa V., on February 5, 1989. Guadalupe was detained and placed in foster care on February 24, *104 1989, when both Rosa and Guadalupe's father, Irineo A., were incarcerated on narcotics charges. A Welfare and Institutions Code[1] section 300 petition was filed on February 28, 1989, alleging Guadalupe's parents were unable to provide for her support. This petition was amended in May 1989 to additionally allege that Guadalupe had been born addicted to cocaine and had developed serious medical problems which rendered her parents incapable of caring for her.
A combined adjudication and disposition hearing was held July 5, 1989. The court found the allegations of the petition to be true and adjudged Guadalupe a dependent child of the court. The court ordered Guadalupe to remain in foster care with reunification services to be provided to her parents.
The 12-month status review hearing was continued 4 times for various reasons. Consequently, the hearing did not take place until December 3, 4, 5, 13, 14, and 19, 1990, nearly 18 months after the initial disposition hearing. At the outset, the referee noted there was no additional reunification time available.
At the close of the department of social service's (DSS) case on December 14, the court made a sua sponte motion under section 350, subdivision (c) on the ground DSS had not met its burden of establishing, by a preponderance of the evidence, that returning the child to her mother would create a substantial risk of detriment to the child's physical or emotional well-being. The court requested argument from counsel on why this motion should not be granted. Guadalupe's counsel objected on the ground that, as the party in interest, Guadalupe should have an opportunity to present her case to the court.
On December 18, 1990, Guadalupe's counsel filed a motion for a "new trial" (hereinafter mistrial) on the ground that the referee had engaged in misconduct when she contacted Guadalupe repeatedly at a party during the pendency of the proceeding. On December 19, 1990, the referee denied the motion for a mistrial and granted the section 350, subdivision (c) motion. The referee then ordered that Guadalupe be immediately returned to Rosa. This court stayed the referee's order.

STATEMENT OF FACTS
When she was five weeks old, Guadalupe was placed with Nita Davis, her current foster mother, as a special-needs baby. Guadalupe was irritable and *105 inconsolable, symptoms of her cocaine withdrawal. Guadalupe would occasionally stop breathing (apnea) and her heart rate would slow down (bradycardia). Consequently, Guadalupe was placed on an apnea monitor to alert her caretaker when these apnea and bradycardia episodes occurred. Guadalupe also suffered from seizures, for which phenobarbital was prescribed.
Guadalupe is microcephalic, i.e., she has a very small head circumference. This condition indicates brain damage as does the mild cerebral palsy, weakness on one side of the body, and seizures suffered by Guadalupe. Due to this brain damage, Guadalupe has a high probability of having at least a learning disability as well as behavioral problems.
At the time of trial, Guadalupe was still taking phenobarbital to control her seizures. She was also very vulnerable to external stimulation, was irritable, and tended to have a short attention span. Additionally, Guadalupe was suffering from abnormal stranger anxiety.
Although by the time of trial Rosa had completed the court-ordered treatment programs, her visits with Guadalupe had been irregular. Rosa had only 13 visits with Guadalupe in 1989. There were no visits during January, March, June, and July 1990. During this period Rosa was primarily residing in Los Angeles. Beginning in September 1990, Rosa visited with Guadalupe more frequently, including one overnight visit in November. However, Rosa's second child was born in late November 1990 and, at the time of the hearing, Rosa had not seen Guadalupe for almost a month.

DISCUSSION

I. The trial court erred prejudicially in refusing to permit the minor to present evidence before ruling on the section 350, subdivision (c) motion.

At the conclusion of DSS's case on December 14, 1990, the court indicated it was considering granting a motion under section 350, subdivision (c), sua sponte. Minor's counsel objected on the ground that she had not yet had an opportunity to present her case to the court. Nevertheless, following a continuance to permit briefing, the court granted its motion on December 19 without taking further evidence and ordered that Guadalupe be returned immediately to her mother, Rosa.
Section 350, subdivision (c), provides:
"At any hearing in which the probation department bears the burden of proof, after the presentation of evidence on behalf of the probation department *106 has been closed, the court, on motion of the minor, parent or guardian, or on its own motion, shall order whatever action the law requires of it if the court, upon weighing the evidence then before it, finds that the probation department has not met its burden. That action includes, but is not limited to, the dismissal of the petition and release of the minor at a jurisdictional hearing, the return of the minor at an out-of-home review held prior to the permanency planning hearing, or the termination of jurisdiction at an inhome review. If the motion is not granted, the minor, parent, or guardian may offer evidence without first having reserved that right." At this hearing, DSS had the burden of establishing that the return of Guadalupe to her mother would create a substantial risk of detriment to Guadalupe's physical or emotional well-being. (§ 366.21, subd. (f).)
In granting the section 350, subdivision (c) motion, the court noted that none of the witnesses who testified regarding the potentially detrimental effect of abruptly returning Guadalupe to Rosa were experts in that area, i.e., psychologists or psychiatrists. The court therefore characterized all the testimony given by the health care providers concerning what was better for Guadalupe as lay opinion. The court stated, "I don't believe that the medical doctors can make that assessment. They can make those recommendations. I think it is up to the court to decide whether there is a substantial detriment to the minor. Based on the testimony that was before me [I] cannot make that decision." Guadalupe's counsel responded that if "the minor had an opportunity to put on evidence, we could show there is substantial risk of detriment to the emotional health of the minor." Counsel further stated she had three psychiatrists who were prepared to testify on this issue. Nevertheless, the only further evidence the court permitted was on the limited issue of whether the foster parents should continue visiting with Guadalupe.
(1a) When ruling in dependency proceedings, the welfare of the minor is the paramount concern of the court. (In re Michael S. (1981) 127 Cal. App.3d 348, 359 [179 Cal. Rptr. 546].) The purpose of these proceedings is not to punish the parent, but to protect the child. (In re Malinda S. (1990) 51 Cal.3d 368, 384 [272 Cal. Rptr. 787, 795 P.2d 1244].) As a person, the child's future is as vitally affected as is that of the parties competing for his or her custody. (In re Dunlap (1976) 62 Cal. App.3d 428, 438 [133 Cal. Rptr. 310].) Consequently, a trial court should not restrict or prevent testimony on formalistic grounds. On the contrary, the court should avail itself of all evidence which might bear on the child's best interest. (Charles S. v. Superior Court (1985) 168 Cal. App.3d 151, 157 [214 Cal. Rptr. 47].)
Here, counsel was appointed for the minor under section 317. Once appointed, counsel for a minor is charged in general with representation of *107 the minor's interests. To this end, counsel must make further investigations as deemed necessary to ascertain the facts and must examine and cross-examine witnesses in both the adjudicatory and dispositional hearings. Additionally, the minor's counsel may introduce and examine his or her own witnesses, make recommendations to the court concerning the minor's welfare, and participate further in the proceedings to the degree necessary to adequately represent the minor. Section 317 also requires the court to take whatever appropriate action is necessary to fully protect the interests of the minor. (§ 317, subd. (e).)
The trial court's refusal to permit Guadalupe's counsel to present evidence before ruling on the section 350, subdivision (c) motion did not run afoul of section 350. In fact, the court's action was consistent with that statute. However, the literal application of section 350, subdivision (c) in this case was inconsistent with the mandate to fully protect the interests of the minor. (2) A statute is not to be construed in isolation, but rather, must be read "`with reference to the entire scheme of law of which it is part so that the whole may be harmonized and retain effectiveness.'" (People v. Pieters (1991) 52 Cal.3d 894, 899 [276 Cal. Rptr. 918, 802 P.2d 420].)
(1b) In refusing to permit the minor to present her expert testimony on the psychological effect of immediate reunification with Rosa, the trial court risked the well-being of the minor because DSS did not present a complete case under the particular facts of this case. Interpreting section 350, subdivision (c) in this manner defeats the policy and purpose of the dependency statutes. For this reason we conclude that section 350, subdivision (c) should be interpreted as permitting pertinent evidence offered by another party to be presented before the motion is ruled on. In this way, the paramount policy of protecting the best interests of the child is promoted. Thus, the trial court erred in refusing the minor's proffered evidence. Since this evidence would have cured what the court characterized as a deficiency in DSS's case, the error must be deemed prejudicial.

II. The referee's social contact with the minor during the trial constituted judicial misconduct.

While the resolution of this issue is not essential to the disposition of the appeal or the writ, we nonetheless will treat it for the guidance of juvenile court referees in future cases.
On December 10, 1990, following three days of trial, the referee attended a Christmas party hosted by DSS for foster families. Mrs. Davis, Guadalupe's foster mother, and Guadalupe were also present. While at this party, the referee initiated contact with Guadalupe and Mrs. Davis three times. The *108 referee introduced Guadalupe and Mrs. Davis to her own family and discussed Guadalupe's size and health with Mrs. Davis. The last time she approached Guadalupe, the referee picked Guadalupe up and carried her away for five minutes. When the referee returned Guadalupe, she commented on how quiet Guadalupe was.
On either December 11 or 12, the referee stated to Guadalupe's counsel that she had held her client. Counsel had not been at the party. In this context, the referee mentioned the foster mother's remark that Guadalupe did not usually go to "strangers" and commented that Guadalupe went with her without any problems.
On December 13 the hearing resumed and on December 14 the referee made the section 350, subdivision (c) motion. The hearing was continued to December 19. On December 18 Guadalupe's counsel filed a motion for mistrial based on the alleged misconduct of the referee in contacting the minor and the foster mother outside the courtroom during the pendency of the proceedings to determine custody of the minor. Counsel for both parents, Rosa and Irineo, objected to the motion on the ground that counsel's failure to bring up the alleged irregularity at the earliest opportunity, i.e., December 13, constituted a waiver. Guadalupe's counsel responded that filing the motion was a difficult decision and that she had needed time to research the issue. The court responded that there could have been some verbal indication that counsel was contemplating such a motion. Nevertheless, the court ruled on the merits of the motion finding that this "chance social encounter" did not "rise to the level of judicial misconduct."
(3) On appeal, Rosa and Irineo have again taken the position that Guadalupe's counsel waived any claim of judicial misconduct by failing to make a timely objection. Counsel may waive such a claim by failing to make a timely motion for mistrial. (Gimbel v. Laramie (1960) 181 Cal. App.2d 77, 85-86 [5 Cal. Rptr. 88].) In general, claims of bias and prejudice on the part of the trial judge must be made at the earliest practicable opportunity after learning of the grounds therefor. (Schrader Iron Works, Inc. v. Lee (1972) 26 Cal. App.3d 621, 641 [103 Cal. Rptr. 106].) Here, however, the waiver issue was decided by the trial court. By ruling on the merits of the motion, the court impliedly found the claim of alleged misconduct had not been waived. The record does not require a finding of waiver as a matter of law. Therefore, this implied finding should be upheld.
(4) When a trial judge sits as the trier of fact, the judge takes the place of a jury, and his or her conduct is subject to the same rules. (McVey v. McVey (1955) 132 Cal. App.2d 120, 123 [281 P.2d 898].) Consequently, the judge cannot receive information from sources outside the evidence in the *109 case or conduct any out-of-court experiments. (Cf. Jones v. Sieve (1988) 203 Cal. App.3d 359, 367 [249 Cal. Rptr. 821]; People v. Castro (1986) 184 Cal. App.3d 849, 853 [229 Cal. Rptr. 280].) Further, although a harmless communication with a party or a witness is not misconduct, it is generally considered misconduct to engage in serious discussion with those persons. (Cf. City of Los Angeles v. Lowensohn (1976) 54 Cal. App.3d 625, 637 [127 Cal. Rptr. 417].) By undertaking a collateral investigation, the judge abdicates his or her responsibility for deciding the parties' dispute on the pleadings and evidence properly brought before the court. (Wenger v. Commission on Judicial Performance (1981) 29 Cal.3d 615, 632 [175 Cal. Rptr. 420, 630 P.2d 954].)
(5) Thus, the issue here is whether the referee's contact with Guadalupe was merely a "harmless communication" or whether it amounted to a receipt of information concerning the case from sources outside the evidence. Although the referee's first contact with Guadalupe and Mrs. Davis could reasonably be considered a harmless "social encounter," the referee's initiation of further interaction with Guadalupe is troublesome. There had been testimony that Guadalupe suffered from abnormal "stranger anxiety." By picking Guadalupe up and carrying her away from her foster mother, the referee was essentially conducting an experiment regarding this alleged "stranger anxiety." The referee's comment that Guadalupe went with her without any problems indicates the referee considered her personal experience with Guadalupe in evaluating the case. Whether intentionally or not, the referee received information concerning Guadalupe outside the courtroom at a time when the trial was in progress. This receipt of information on a contested issue cannot be deemed harmless. Rather, it must be characterized as judicial misconduct, and the motion for mistrial should have been granted.
(6) DSS filed a brief in the appeal on May 29, 1991, requesting this court dissolve the stay based on a "change of circumstances." DSS submitted a declaration from the case manager, a social worker, to support its changed position. The minor has moved to strike this declaration on the ground it is matter outside the appellate record.
An appellate court is confined in its review to the proceedings which took place in the trial court. (Bach v. County of Butte (1989) 215 Cal. App.3d 294, 306 [263 Cal. Rptr. 565].) Thus, the minor's motion to strike should be granted. The alleged "changed circumstances" are outside the scope of review.


*110 DISPOSITION
The order appealed from is reversed. The matter is remanded for further proceedings before another referee. The petition for extraordinary relief is denied.
Martin, Acting P.J., and Harris, J., concurred.
A petition for a rehearing was denied October 10, 1991.
NOTES
[*]   Retired Presiding Justice of the Court of Appeal, Fifth District, sitting under assignment by the Chairperson of the Judicial Council.
[1]  All statutory references are to the Welfare and Institutions Code unless otherwise indicated.
