BUG: fix IntervalIndex for pivot table raise type error 
Close (#25814). When use IntervalIndex for pivot table, raise
TypeError: cannot determine next label for type <class 'str'> 
- [x] closes #25814
- [x] tets added / passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry
