BUG: RollingGroupby.corr() producing incorrect results
- [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                                                                                                                                                                                          
# sample dataframe. We order it by column c                                                                                                                                                                                                    
df = pd.DataFrame({                                                                                                                                                                                          
    "a": ["g1"]*4 + ["g2"]*4,                                                                                                                                                                                
    "b": range(8),                                                                                                                                                                                           
    "c": [0, 4, 6, 1, 2, 7, 3, 5]                                                                                                                                                                            
}).sort_values("c")                                                                                                                                                                                          
df                                                                                                                                                                                                           
```                                                                                                                                                                                                          
                                                                                                                                                                                                             
                                                                                                                                                                                                             
                                                                                                                                                                                                             
                                                                                                                                                                                                             
<div>                                                                                                                                                                                                          
<table border="1" class="dataframe">                                                                                                                                                                         
  <thead>                                                                                                                                                                                                    
    <tr style="text-align: right;">                                                                                                                                                                          
      <th></th>                                                                                                                                                                                              
      <th>a</th>                                                                                                                                                                                             
      <th>b</th>                                                                                                                                                                                             
      <th>c</th>                                                                                                                                                                                             
    </tr>                                                                                                                                                                                                    
  </thead>                                                                                                                                                                                                   
  <tbody>                                                                                                                                                                                                    
    <tr>                                                                                                                                                                                                     
      <th>0</th>                                                                                                                                                                                             
      <td>g1</td>                                                                                                                                                                                            
      <td>0</td>                                                                                                                                                                                             
      <td>0</td>                                                                                                                                                                                             
    </tr>                                                                                                                                                                                                    
    <tr>                                                                                                                                                                                                     
      <th>3</th>                                                                                                                                                                                             
      <td>g1</td>                                                                                                                                                                                            
      <td>3</td>                                                                                                                                                                                             
      <td>1</td>                                                                                                                                                                                             
    </tr>                                                                                                                                                                                                    
    <tr>                                                                                                                                                                                                     
      <th>4</th>                                                                                                                                                                                             
      <td>g2</td>                                                                                                                                                                                            
      <td>4</td>                                                                                                                                                                                             
      <td>2</td>                                                                                                                                                                                             
    </tr>                                                                                                                                                                                                    
    <tr>                                                                                                                                                                                                     
      <th>6</th>                                                                                                                                                                                             
      <td>g2</td>                                                                                                                                                                                            
      <td>6</td>                                                                                                                                                                                             
      <td>3</td>                                                                                                                                                                                             
    </tr>                                                                                                                                                                                                    
    <tr>                                                                                                                                                                                                     
      <th>1</th>                                                                                                                                                                                             
      <td>g1</td>                                                                                                                                                                                            
      <td>1</td>                                                                                                                                                                                             
      <td>4</td>                                                                                                                                                                                             
    </tr>                                                                                                                                                                                                    
    <tr>                                                                                                                                                                                                     
      <th>7</th>                                                                                                                                                                                             
      <td>g2</td>                                                                                                                                                                                            
      <td>7</td>                                                                                                                                                                                             
      <td>5</td>                                                                                                                                                                                             
    </tr>                                                                                                                                                                                                    
    <tr>                                                                                                                                                                                                     
      <th>2</th>                                                                                                                                                                                             
      <td>g1</td>                                                                                                                                                                                            
      <td>2</td>                                                                                                                                                                                             
      <td>6</td>                                                                                                                                                                                             
    </tr>                                                                                                                                                                                                    
    <tr>                                                                                                                                                                                                     
      <th>5</th>                                                                                                                                                                                             
      <td>g2</td>                                                                                                                                                                                            
      <td>5</td>                                                                                                                                                                                             
      <td>7</td>                                                                                                                                                                                             
    </tr>                                                                                                                                                                                                    
  </tbody>                                                                                                                                                                                                   
</table>                                                                                                                                                                                                     
</div>

```python
(df.groupby("a")[["b", "c"]]
        .rolling(3)
        .corr()
        .unstack()
        .iloc[:, 1]
        .droplevel("a")
        .sort_index())
```




    0         NaN
    1         NaN
    2    0.155543
    3         NaN
    4    0.960769
    5   -0.397360
    6    0.981981
    7         NaN
    Name: (b, c), dtype: float64




```python
# this result should be no different than above - sorting by groupby key should not be necessary
(df.sort_values(["a", "c"]).groupby("a")[["b", "c"]]
        .rolling(3)
        .corr()
        .unstack()
        .iloc[:, 1]
        .droplevel("a")
        .sort_index())
```




    0         NaN
    1    0.052414
    2   -0.596040
    3         NaN
    4         NaN
    5   -0.500000
    6         NaN
    7    0.928571
    Name: (b, c), dtype: float64


#### Problem description

This RollingGroupby.corr() operation is producing incorrect results. The example above shows how sorting the dataframe with respect to the groupby key fixes the issue, but that should not be necessary since it is the groupby key. I have tested and this bug does not exist in version `1.2.5`. It first appears in `1.3.0`. 

#### Expected Output
The bottom part of the above repro contains expected output. Here's another way of showing expected output by filtering to one group:
```python
(df[df['a'] == "g1"]
        .groupby("a")[["b", "c"]]
        .rolling(3)
        .corr()
        .unstack()
        .iloc[:, 1]
        .droplevel("a")
        .sort_index())
```

    0         NaN
    1    0.052414
    2   -0.596040
    3         NaN
    Name: (b, c), dtype: float64

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

<details>

INSTALLED VERSIONS
------------------
commit           : 5f648bf1706dd75a9ca0d29f26eadfbb595fe52b
python           : 3.8.10.final.0
python-bits      : 64
OS               : Linux
OS-release       : 4.18.0-240.22.1.el8_3.x86_64
Version          : #1 SMP Thu Mar 25 14:36:04 EDT 2021
machine          : x86_64
processor        : x86_64
byteorder        : little
LC_ALL           : None
LANG             : en_US.UTF-8
LOCALE           : en_US.UTF-8

pandas           : 1.3.2
numpy            : 1.21.2
pytz             : 2021.1
dateutil         : 2.8.2
pip              : 21.2.4
setuptools       : 57.4.0
Cython           : None
pytest           : 6.2.5
hypothesis       : None
sphinx           : None
blosc            : None
feather          : None
xlsxwriter       : None
lxml.etree       : None
html5lib         : None
pymysql          : None
psycopg2         : None
jinja2           : 3.0.1
IPython          : 7.27.0
pandas_datareader: None
bs4              : None
bottleneck       : None
fsspec           : 0.8.7
fastparquet      : None
gcsfs            : None
matplotlib       : 3.4.3
numexpr          : None
odfpy            : None
openpyxl         : None
pandas_gbq       : None
pyarrow          : 5.0.0
pyxlsb           : None
s3fs             : 0.4.2
scipy            : 1.7.1
sqlalchemy       : None
tables           : None
tabulate         : None
xarray           : None
xlrd             : 2.0.1
xlwt             : None
numba            : None
</details>
