Lawyer ‘shocked’ by judge’s attack on personal injury claims