TST: Test sorting levels not aligned with index (#25775)
- [x] closes #25775
- [x] tests added / passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry (empty since no user-facing changs)

With `master` at 6d2398a58fda68e40f116f199439504558c7774c, issue #25775 seems resolved. Added validation tests.