Digging in to the debug, I see that when going back to page #1, parseRoute($segments) function does not get called. It does get called when initially going to page 1 and every time you go to another page. It appears that it's only skipped when returning to page 1.
This results in the $segments variable not being set to
Array
(
[ 0 ] => results,1-0
)
Additionally, and I'm not sure whether it's related or not, I see that $limitstart doesn't get set when returning to page 1. It is set to 0 when initially going to page 1 and to 10 (for example) when going to page 2, but when returning to page 1, it is null.
Note that I'm not very confident in this last statement, because the buildRoute(&$query) function, where $start, $limit, and $limitstart are set, is called multiple times one one page, each time with different results (category, itemid, cart, etc.).
Hope this helps to determine how to fix the issue. My PHP skills are not sufficient to solve this one.