DOC: Improve error message to show correct order
- [x] closes #23644
- [x] Test udpated for `sections_in_wrong_order`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry
