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
user = self._create_user("tim")
            self.client.force_login(user)
            person_factory(
                properties={"email": "tim@posthog.com"}, team=self.team, distinct_ids=["2", "some-random-uid"],
            )
            with freeze_time("2020-01-10"):
                event1 = event_factory(team=self.team, event="sign up", distinct_id="2")
            with freeze_time("2020-01-8"):
                event2 = event_factory(team=self.team, event="sign up", distinct_id="2")
            with freeze_time("2020-01-7"):
                event3 = event_factory(team=self.team, event="random other event", distinct_id="2")
            action = Action.objects.create(team=self.team)
            ActionStep.objects.create(action=action, event="sign up")
            action.calculate_events()
            response = self.client.get("/api/event/?after=2020-01-09T00:00:00.000Z&action_id=%s" % action.pk).json()
            self.assertEqual(len(response["results"]), 1)
            self.assertEqual(response["results"][0]["id"], event1.pk)
            response = self.client.get("/api/event/?before=2020-01-09T00:00:00.000Z&action_id=%s" % action.pk).json()
            self.assertEqual(len(response["results"]), 1)
            self.assertEqual(response["results"][0]["id"], event2.pk)
            
            response = self.client.get("/api/event/?after=2020-01-09T00:00:00.000Z").json()
            self.assertEqual(len(response["results"]), 1)
            self.assertEqual(response["results"][0]["id"], event1.pk)
            response = self.client.get("/api/event/?before=2020-01-09T00:00:00.000Z").json()
            self.assertEqual(len(response["results"]), 2)
            self.assertEqual(response["results"][0]["id"], event2.pk)
            self.assertEqual(response["results"][1]["id"], event3.pk)
        def test_pagination(self):