We experienced the same issue and will just quickly note our guess (and a possible solution):
in externallib.php of moodle-local_ws_enrolcohort in line 329
is called. This has a hardcoded limit of 25 items as seen in line 239 of
This limit makes some sense for paged views, but of course is not helpful here, as whenever there are more than 25 cohorts, only the first 25 will be returned.
Changing the call to
cohort_get_available_cohorts($context, 0, 0, 0)
resolves the problem for us.