Sentry Issue: [POSTHOG-355](https://sentry.io/organizations/posthog/issues/2486864883/?referrer=github_integration)

```
Cohort.DoesNotExist: Cohort matching query does not exist.
(4 additional frame(s) were not displayed)
...
  File "ee/clickhouse/queries/sessions/list.py", line 155, in format_action_filters
    condition_sql, filter_params = format_action_filter_aggregate(entity, prepend=f"event_matcher_{index}")
  File "ee/clickhouse/queries/sessions/list.py", line 176, in format_action_filter_aggregate
    filters, filter_params = parse_prop_clauses(entity.properties, prepend=prepend, team_id=None)
  File "ee/clickhouse/models/property.py", line 41, in parse_prop_clauses
    cohort = Cohort.objects.get(pk=prop.value, team_id=team_id)
  File "django/db/models/manager.py", line 85, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "django/db/models/query.py", line 429, in get
    raise self.model.DoesNotExist(
```
ee/clickhouse/queries/event_query.py
pass
    def _get_disintct_id_query(self) -> str:
        if self._should_join_distinct_ids:
            return f"""
            INNER JOIN (
                SELECT person_id,
                    distinct_id
                FROM (
                        SELECT *
                        FROM person_distinct_id
                        JOIN (
                                SELECT distinct_id,
                                    max(_offset) as _offset
                                FROM person_distinct_id
                                WHERE team_id = %(team_id)s
                                GROUP BY distinct_id
                            ) as person_max
                            ON person_distinct_id.distinct_id = person_max.distinct_id
                        AND person_distinct_id._offset = person_max._offset
                        WHERE team_id = %(team_id)s
                    )
                WHERE team_id = %(team_id)s
            ) AS {self.DISTINCT_ID_TABLE_ALIAS}
            ON events.distinct_id = {self.DISTINCT_ID_TABLE_ALIAS}.distinct_id
            """
        else:
            return ""
    def _determine_should_join_persons(self) -> None: