Adruino IDE vs VS Code

  • I am facing a strange issue and I am sure there must be something I am missing, so I am kindly asking for your assistance.

    I am testing this code:

    The PaHub scanner with a M5Core Basic device (the one in the PM2.5 Air quality kit).

    The code uploaded with Arduino IDE works just fine. It displays existing addresses.
    However, the code uploaded with VSCode with Platformio does not. It is not detecting any of the I2C device addresses.

    The plafromio.ini:
    platform = espressif32
    board = m5stack-core-esp32
    framework = arduino
    lib_deps =
    closedcube/ClosedCube I2C Driver@^2020.9.8
    closedcube/ClosedCube TCA9548A@^2020.5.21

    I have checked the source code of the libraries used (M5Stack and ClosedCube_TCA9548A) and they seem identical.

    I cannot understand what I a missing.

    Thank you!