Check boundary undefined with non-default close parameter for DatetimeIndex #23198
- [X] closes #23198 
- [ ] tests added / passed
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry
