@Peter212355 I am unable to duplicate the error you are experiencing.
Pico W loaded rp2-pico-w-20221014-unstable-v1.19.1-544-g89b320737.uf2
Copied to Pico W from Core Electronics GitHub using Thonny the following files.
PiicoDev_Unified.py
PiicoDev_BME280.py
main.py
Ran ok as per web page screen shot.
Copied your code to Pico W, produced temp pressure and humidity values.
I think Core have updated the Piicodev files based on the post from @Michael.
Regards
Jim