issue #22394: account for cases where relations are defined in orm extensions