TST: Dataframe KeyError when getting nonexistent category (#28799)
- [x] closes #28799 
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry
Added test to check for correct exception when accessing a nonexistent category in a DataFrame. 