BUG: in error message raised when invalid axis parameter
- [x] closes #25555
- [x] tests added / passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry

I don't think there is currently an issue for this. will open new and then add whatsnew.