we had the problem which was described above. Our moodle is running on 2.4.3 and has over 17K courses within a single category.
To overcome this problem we changed the value of define('MAX_COURSES_IN_CATEGORY', 10000); to define('MAX_COURSES_IN_CATEGORY', 1000000);
There is another setting define('MAX_COURSE_CATEGORIES', 10000); (max number of categories) which we have not amended.
Note that MAX_COURSES_IN_CATEGORY and MAX_COURSE_CATEGORIES will be multiplied together and the result should not exceed 2147483647 ( max int value).
We have also defined the setting in config.php so that when upgrading, we would not need to remember setting the value again.
Do Moodle developers have some comments to make on my posts? ie it is this the correct way to overcome the problem?