Fix flake8 issues on v22, v23 and v24rst
- [x] closes #24200, #24201 and #24202 
- [x] `flake8-rst source/whatsnew/v0.22.0.rst` and `flake8-rst source/whatsnew/v0.23.0.rst` 
This is related to #24177

