TST: setitem in presence of duplicate cols
- [ ] closes #23239
- [ ] tests added / passed
- [ ] passes `black pandas`
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry

Add tests required to close the issue.
The tests are based on the example in the issue.