REGR: Fixed AssertionError in groupby
Closes https://github.com/pandas-dev/pandas/issues/31522


cc @jbrockmendel. Just raising a `TypeError` when that assert failed didn't work. The `finally` still runs, which raised an assertion error.

It seemed easier to try to just support this case. IIUC, it only occurs when an `(P, n_rows)` input block gets split into `P` result blocks. I believe that

1. The result blocks should all have the same dtype
2. The input block must not have been an extension block, since it's 2d

So it *should* be safe to just cast the result values into an ndarray. Hopefully...

Are there any edge cases I'm not considering? Some kind of `agg` that returns a result that can't be put in a 2D block? Even something like `.agg(lambda x: pd.Period())` 
won't hit this, since it has to be a Cython function. 