The Massachusetts Court of Appeals reversed a defendant's conviction for failure to register as a sex offender Friday, finding that proposed expert testimony about his mental state would have shown whether the "knowingly" element of the charge was met.