BUG: pivot/unstack leading to too many items should raise exception

- [x] closes #20601
- [x] tests added / passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry