BUG: Removed bug from groupby/min on categoricals 
- [ x] closes #52151 (Replace xxxx with the GitHub issue number)
- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.

Can you add a test for the fixed bug Yes but where?
tests.groupby.test_min_max.py 
or
tests.groupby.text_categorical.py  ... maybe ?  either of those would be fine, i guess the min_max one would be my preference. @jbrockmendel I added the test. I think that the failings are not related with what I did, but I'm not sure.  Could you merge the main branch once more? Done.  Thanks @DeaMariaLeon  Thank you