BUG: Fix bug in GroupBy that ignores group_keys arg for empty datafra…
…mes/series

- [x] closes #60471(Replace xxxx with the GitHub issue number)
- [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).
- [x] Added an entry in the latest `doc/source/whatsnew/v3.0.0.rst` file if fixing a bug or adding a new feature.

When using `groupby.apply` on an empty dataframe or series with `group_keys=False`, the output index is incorrectly set to the grouping keys, while it is expected to be a `RangeIndex(0, 0, 1)`.
From the original issue:
```
>>> df = pd.DataFrame({'A': [], 'B': [], 'C': []})
>>> g2 = df.groupby('A', group_keys=False)
>>> r2 = g2.apply(lambda x: x / x.sum())
>>> print(r2.index)
Index([], dtype='float64', name='A')
```
Expected:
```
>>> print(r2.index)
RangeIndex(start=0, stop=0, step=1)
```
Thanks @snitish 