BUG: dataframe setitem error on size incompatible assignment
- [ ] closes #40827
- [ ] tests added / passed
- [ ] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing.html#code-standards) for how to run them

I've labeled the error something silly but that can be fixed later.

This pull request replaces this older pr #41008 

I've put all my tests inside one file for easier review.

### Issues
I'm unsure how to stop this test from failing `test_pivot_table_doctest_case` Could you help with this?

This test (`test_invalid_colormap`) also fails but when I rerun it individually, it passes ...

I also had an issue with flake8 and black not working together ... in my most recent commit so I just committed it with `--no-verify`.