Fix groupby-resample KeyError when resampling on Index and giving explicit list of columns. (1.5.x)
- [x] closes #50840
- [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 [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [x] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.

Pandas Devs:
I updated the 1.5.x branch with the fix. Please reply with instructions on if I should add the fix and test code to the main branch as well, or if you would like to do that. This is my first contribution to Pandas, so I'm unfamiliar with the workflow at this point. PRs should generally always target the main branch. This bug fix should also target 2.0 and not 1.5.x as this doesn't appear like a regression per se @mroeschke, I'll leave this PR open in case you also want to have the changes made to the 1.5.x branch. I'll also open a new PR (linked with this one) where I've applied the fix to the main branch and added to the whatsnew for v2.0 We have a backporting bot that would take care of this (and this fix doesn't appear eligible for it) so will close this one