adds non regression test for GH27358
- [X] closes #27358
- [X] tests added / passed
- [ ] passes `black pandas`
- [X] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry
