Vladislav, hello! The fact is that the functionality works like this:
1. You are on the second page of a category
2. Go to another category, where there are only 9 products
https://prnt.sc/u1656k3. Being on the second page of one category, you go to the second page of another category (and there are no products on this page). Accordingly, the products are not displayed.
I'll give an example:
I am in this category on the second page:
https://prnt.sc/u40qz3Go to this category:
https://prnt.sc/u40rbnAnd we see that I am on the second page:
https://prnt.sc/u40rjaThis is the logic of the functionality