Court orders ‘Save James’ boy to stay with mother who says he’s a girl, gives father limited visitation