Appeals court returns same-sex marriage case to lower court