Judge also told complainant in rape case that ‘pain and sex sometimes go together’