TST: added test for GH28597
Added test to ensure that categories stay ordered when grouping
with missing values.

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