BUG: loc.setitem raising ValueError when df has duplicate columns
- [x] closes #38521
- [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
- [x] whatsnew entry

Is there a more elegant way to check if an element occurs only once in an index? Failure unrelated thanks @phofl 