AssertionError on groupby max
- [x] I have checked that this issue has not already been reported.

- [x] I have confirmed this bug exists on the latest version of pandas.

- [ ] (optional) I have confirmed this bug exists on the master branch of pandas.

---


**Note**: Please read [this guide](https://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports) detailing how to provide the necessary information for us to reproduce your bug.

#### Code Sample, a copy-pastable example

```python
import pandas as pd

def get_data():
    # request data from the server
    return data

datas = get_data()
#datas consist of 2195 rows and 22 column
df = pd.DataFrame(datas)
total = df.groupby('userid').max()['point'].sum()
print(f"sum all point: {total}")

Traceback (most recent call last):
  File "playground-test.py", line 15, in <module>
    total = df.groupby('userid').max()['point'].sum()
  File "/home/playground/.local/lib/python3.6/site-packages/pandas/core/groupby/groupby.py", line 1560, in max
    numeric_only=numeric_only, min_count=min_count, alias="max", npfunc=np.max
  File "/home/playground/.local/lib/python3.6/site-packages/pandas/core/groupby/groupby.py", line 1001, in _agg_general
    how=alias, alt=npfunc, numeric_only=numeric_only, min_count=min_count,
  File "/home/playground/.local/lib/python3.6/site-packages/pandas/core/groupby/generic.py", line 1022, in _cython_agg_general
    how, alt=alt, numeric_only=numeric_only, min_count=min_count
  File "/home/playground/.local/lib/python3.6/site-packages/pandas/core/groupby/generic.py", line 1135, in _cython_agg_blocks
    assert len(locs) == result.shape[1]
AssertionError
```

```python
import pandas as pd

def get_data():
    # request data from the server
    return data

datas = get_data()
#let's copy dataframe and only include 2 column
df_copy = df[['userid','point']].copy()
total = df_copy.groupby('userid').max()['point'].sum()
print(f"sum all point: {total}")

64511636

```

#### Problem description

`groupby` `max` function on dataframe that consist of 22 column does make error with AssertionError. However, if I tried to made smaller dataframe with 2 column. It does work.
I am on Pandas 1.1.5 and I dont know why, I can't upgrade to 1.2.4

```linux
$pip3 install pandas --upgrade
Requirement already satisfied: pandas in /home/playground/.local/lib/python3.6/site-packages (1.1.5)
Requirement already satisfied: pytz>=2017.2 in /usr/local/lib/python3.6/site-packages (from pandas) (2020.1)
Requirement already satisfied: numpy>=1.15.4 in /usr/local/lib64/python3.6/site-packages (from pandas) (1.19.5)
Requirement already satisfied: python-dateutil>=2.7.3 in /usr/local/lib/python3.6/site-packages (from pandas) (2.8.1)
Requirement already satisfied: six>=1.5 in /home/playground/.local/lib/python3.6/site-packages (from python-dateutil>=2.7.3->pandas) (1.15.0)
```
```linux
$$ pip3 install pandas==1.2.4
ERROR: Could not find a version that satisfies the requirement pandas==1.2.4
ERROR: No matching distribution found for pandas==1.2.4
```
#### Expected Output

#### Output of ``pd.show_versions()``

<details>

INSTALLED VERSIONS
------------------
commit           : b5958ee1999e9aead1938c0bba2b674378807b3d
python           : 3.6.8.final.0
python-bits      : 64
OS               : Linux
OS-release       : 3.10.0-1160.24.1.el7.x86_64
Version          : #1 SMP Thu Apr 8 19:51:47 UTC 2021
machine          : x86_64
processor        : x86_64
byteorder        : little
LC_ALL           : en_US.utf-8≈
LANG             : en_US.utf-8
LOCALE           : en_US.UTF-8

pandas           : 1.1.5
numpy            : 1.19.5
pytz             : 2020.1
dateutil         : 2.8.1
pip              : 21.0.1
setuptools       : 56.0.0
Cython           : None
pytest           : None
hypothesis       : None
sphinx           : None
blosc            : None
feather          : None
xlsxwriter       : None
lxml.etree       : 4.5.1
html5lib         : None
pymysql          : 1.0.2
psycopg2         : None
jinja2           : 2.11.2
IPython          : 7.16.1
pandas_datareader: None
bs4              : 4.9.1
bottleneck       : None
fsspec           : None
fastparquet      : None
gcsfs            : None
matplotlib       : 3.3.4
numexpr          : None
odfpy            : None
openpyxl         : None
pandas_gbq       : None
pyarrow          : None
pytables         : None
pyxlsb           : None
s3fs             : None
scipy            : 1.5.4
sqlalchemy       : 1.4.7
tables           : None
tabulate         : None
xarray           : None
xlrd             : None
xlwt             : None
numba            : None

</details>
