BUG: fix valueError for groupby with empty inputs when sample method is called
- [x] closes ##48459
- [x] [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
- [x] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).

Looks pretty good. Could use a whatsnew note in `1.6.0.rst` under the groupby section. Thanks @Th3nn3ss 