BUG: Ensure same index is returned for slow and fast path in groupby.apply
This _fixes_ the internal check to be consistent with the slow apply path

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