BUG: Fix groupby nth with axis=1
Fixes a bug that no one has reported and probably no one cares about. But overlaps slightly with #42947, so I thought that I would make it a separate PR.

Current behaviour: `df.groupby(df.iloc[1], axis=1).nth(0)` crashes ungracefully.