TST: added test for fixed bug  gh#50372
- [x] closes #50372 
- [x] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests)
- [x] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).

I added a test to prevent the bug described in GG#50372 from happening again.

Thanks @DRiXD 