I see the situation is explained here:
https://wiki.seeedstudio.com/xiao_esp32s3_bluetooth/#:~:text=)%3B }-,TIP,-If%20you%20have
If you have already upgrade your ESP32 development board to version 3.0.0 above, you need to change some code to compatible with it.
BLEScanResults foundDevices = pBLEScan->start(scanTime, false);change toBLEScanResults* foundDevices = pBLEScan->start(scanTime, false);Serial.println(foundDevices.getCount());change toSerial.println(foundDevices->getCount());
So change line 29 of the sketch from this:
BLEScanResults foundDevices = pBLEScan->start(scanTime, false);
to this:
BLEScanResults* foundDevices = pBLEScan->start(scanTime, false);
Then change line 31 from this:
Serial.println(foundDevices.getCount());
to this:
Serial.println(foundDevices->getCount());
After making those changes try compiling the sketch again. Hopefully this time everything will work as expected.