BUG: add sorting_reamaining=True to avoid IndexError GH25831
- [x] closes #25831
- [x] tests added / passed
- [ ] passes `black pandas`
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry
