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(
```
posthog/api/test/test_event.py
person_factory(
                properties={"email": "tim@posthog.com"},
                team=self.team,
                distinct_ids=["2", "some-random-uid"],
                is_identified=True,
            )
            event_factory(
                event="$autocapture",
                team=self.team,
                distinct_id="2",
                properties={"$ip": "8.8.8.8"},
                elements=[Element(tag_name="button", text="something"), Element(tag_name="div")],
            )
            event_factory(
                event="$pageview", team=self.team, distinct_id="some-random-uid", properties={"$ip": "8.8.8.8"}
            )
            event_factory(
                event="$pageview", team=self.team, distinct_id="some-other-one", properties={"$ip": "8.8.8.8"}
            )
            expected_queries = 4 if settings.PRIMARY_DB == RDBMS.CLICKHOUSE else 11
            with self.assertNumQueries(expected_queries):
                response = self.client.get("/api/event/?distinct_id=2").json()
            self.assertEqual(
                response["results"][0]["person"],
                {"distinct_ids": ["2"], "is_identified": True, "properties": {"email": "tim@posthog.com"}},
            )
            self.assertEqual(response["results"][0]["elements"][0]["tag_name"], "button")
            self.assertEqual(response["results"][0]["elements"][0]["order"], 0)
            self.assertEqual(response["results"][0]["elements"][1]["order"], 1)
        def test_filter_events_by_event_name(self):