My research indicates that this might caused by a bug in libxml2, but regardless, a minimal fix is to change the link generation code to use [position()=last()] instead of [last()] in the predicate on the union of reverse axes. Patch attached.
Thanks for the patch.
I tested it and with patch the Prev tab works fine towards 45.6. (previous chapter's end)