BUG: Misleading Error Message when column is duplicated
### 

- [X] I have checked that this issue has not already been reported.

- [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas.

- [X] I have confirmed this bug exists on the master branch of pandas.


### Reproducible Example

```python
df = pd.DataFrame({'a':[1,2,3],'b':[1.1,2.2,3.3]})
# copy the df and duplicate a column
df2 = df[['a','b','b']]
# dtypes over the full df will give results
df2.dtypes
#iterating over columns will end in unclear error message 
for col in df2.columns:
    print(col, df2[col].dtype)
```


### Issue Description

```
df = pd.DataFrame({'a':[1,2,3],'b':[1.1,2.2,3.3]})
df2 = df[['a','b','b']]
df2.dtypes
```
output is 
```
a      int64
b    float64
b    float64
dtype: object
```
On iterating over columns to get dtype for each column, you got the error
```
for col in df2.columns:
    print(col, df2[col].dtype)
```
here's the output
```
a int64
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-357-ec02ef63fa3c> in <module>()
      1 for col in df2.columns:
----> 2     print(col, df2[col].dtype)

/usr/local/lib/python3.7/dist-packages/pandas/core/generic.py in __getattr__(self, name)
   5139             if self._info_axis._can_hold_identifiers_and_holds_name(name):
   5140                 return self[name]
-> 5141             return object.__getattribute__(self, name)
   5142 
   5143     def __setattr__(self, name: str, value) -> None:

AttributeError: 'DataFrame' object has no attribute 'dtype'
```

### Expected Behavior

Error message should state the error root cause or at least some guidance.

### Installed Versions

<details>


INSTALLED VERSIONS
------------------
commit           : b5958ee1999e9aead1938c0bba2b674378807b3d
python           : 3.7.12.final.0
python-bits      : 64
OS               : Linux
OS-release       : 5.4.104+
Version          : #1 SMP Sat Jun 5 09:50:34 PDT 2021
machine          : x86_64
processor        : x86_64
byteorder        : little
LC_ALL           : None
LANG             : en_US.UTF-8
LOCALE           : en_US.UTF-8

pandas           : 1.1.5
numpy            : 1.19.5
pytz             : 2018.9
dateutil         : 2.8.2
pip              : 21.1.3
setuptools       : 57.4.0
Cython           : 0.29.24
pytest           : 3.6.4
hypothesis       : None
sphinx           : 1.8.5
blosc            : None
feather          : 0.4.1
xlsxwriter       : None
lxml.etree       : 4.2.6
html5lib         : 1.0.1
pymysql          : None
psycopg2         : 2.7.6.1 (dt dec pq3 ext lo64)
jinja2           : 2.11.3
IPython          : 5.5.0
pandas_datareader: 0.9.0
bs4              : 4.6.3
bottleneck       : 1.3.2
fsspec           : None
fastparquet      : None
gcsfs            : None
matplotlib       : 3.2.2
numexpr          : 2.7.3
odfpy            : None
openpyxl         : 2.5.9
pandas_gbq       : 0.13.3
pyarrow          : 3.0.0
pytables         : None
pyxlsb           : None
s3fs             : None
scipy            : 1.4.1
sqlalchemy       : 1.4.25
tables           : 3.4.4
tabulate         : 0.8.9
xarray           : 0.18.2
xlrd             : 1.1.0
xlwt             : 1.3.0
numba            : 0.51.2

</details>
