API: better error-handling for df.set_index
- [x] closes #22484
- [x] tests added / passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry

split off of #22236, and so builds on top of it.
