BUG: GH41044 - test loc dict assig
- [x] closes #41044 
- [x] tests added / passed
- [x] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing.html#code-standards) for how to run them
- [ ] whatsnew entry: not sure if it's needed but happy to provide one given some guidelines
@phofl Any idea why the CI checks are failing? It doesn't seem related to the test I added but maybe I'm missing something Did they fail because of a ResourceWarning? 

We have a flaky test, which fails sometimes Yep, that seemed to be the cause. Just pulling in changes from `master` and pushing back to the PR and retriggering the tests seems to have fixed it This test fails now and then, is more or less arbitrary  thanks @arredond very nice!