When a category has >=20 courses in it and the user navigates down the category tree, no "View all courses" link is included for a category if the data for the subtree is being fetched using AJAX requests. For comparison, when the tree is built at page render time, for example if a course within one of these categories is being viewed, the "View all courses" link is there.
The patch at https://github.com/jonof/moodle/commit/c683165a4ad0a15f925d44d48dd393cd2abb509b implements a solution for this problem.
There is already code in blocks/navigation/yui/navigation/navigation.js in the addChild() function that adds the 'view all courses' link if a category was passed in, but this code is never run because the loop in ajaxProcessResponse() is calling addChild() for each course entry. To reduce redundancy I moved this code to a new function that is called by addChild() and ajaxProcessResponse().