where a juvenile appears before a court of summary jurisdiction other than a juvenile court on a charge made jointly against the juvenile and a person who has attained the age of 18 years and the juvenile is convicted by the court, the court shall not sentence the juvenile offender but shall remit the case to the juvenile court for sentence