cubicweb #17074119 KeyError on rql rewrite for constraints insertion [validation pending]

on attempting to edit an EAC authority record in the saem_ref application, I get

 File /home/saemref/venv/lib/python2.7/site-packages/cubicweb/, line 661, function remove_ambiguities:
  varname = self.rewritten[key]
KeyError: (<RQLConstraint(DISTINCT Any O,S WHERE ((NOT EXISTS(Z authority_record S)) OR (EXISTS(A authority_record S, A is Agent, O name "person"))) OR (EXISTS(OU authority_record S, OU is IN(Organization, OrganizationUnit), O name "authority"))) @0x340f250>, (('O', 'O'), ('S', 'S')), u'OU')
done in3.26.0
load left0.000
closed by<not specified>