She ordered a report on Ellery under the Mentally Impaired Persons Act.
The magistrate said there were fears he might not reappear before the court if he was remanded at large and concerns that he could interfere with evidence and potential witnesses.
"There have been allegations already in the last nine months that you have been persuading people that you were not involved."
The court heard how Ellery had been before the courts as recently as August 2010 and previously in 2009 for four bail breaches, although these were relatively minor matters including breaching curfew times.
He is to reappear in the Hamilton District Court next month.
Ms Scott evaded journalists waiting outside court and was shielded by two young men who gestured and yelled obscenities as they left.
Ellery's grandparents would also not answer questions when they left. Mr Ellery, who has cancer, said he was "not well".
A source told the Herald yesterday that police questioned Ms Scott and Mathew Ellery for more than six hours on Sunday.
The person said the pair were still in a relationship at that point but Ms Scott ended things soon after their meeting with the police.
The Herald understands that Ms Scott is looking to seek custody of her two children, Jade, who is nearly a month old and whom Ellery fathered, and Travis, 6, who has a different father.
Both children are at the moment in the care of Child, Youth and Family.
"She wants to get her kids back but she just keeps meeting the wrong guys ... Things aren't that great for her at the moment," the source said.
Ms Scott and Ellery had been living with his grandparents at their Whatawhata farm before they moved to a run-down bedsit in Hamilton East about two weeks ago.
Neighbours at the place, which has a sign describing it as a "holiday camp", told the Herald the pair kept to themselves and were rarely seen.
They were shocked when told that Ellery was facing a charge of murder.
"He was just this skinny little guy," said one neighbour, who gave his name as Hemi.
Also at court was Cherie Kurarangi-Sweeney, founder of the Nation of Advocates for the Rights of Kids group, who said there was a sense of relief in the Ngaruawahia community that someone was being held to account nine months after Serenity's death.
"We are happy that we may finally get some closure in this horrific case," she said. "But it hasn't ended yet and we will be here for every appearance from here on. We will stick it out."
Detective Senior Sergeant Mark Greene could not comment on the specifics of the investigation but again credited the efforts of police who worked with the Ngaruawahia community and Child, Youth and Family.