DOC: Using deprecated sphinx directive instead of non-standard messages in docstrings (#18928)
- [X] closes #18928 
- [X] tests passed
- [X] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry
