Already discussed here on how to find out what platform-espressif32 version matches to what Arduino-ESP32 version.
Especially to be noted is that PlatformIO does not officially support Arduino-ESP32 3.x yet. The latest is 2.0.14, with the current platform = espressif32@6.5.0.
Thank you. I had no doubt this had been addressed previously but my search skills failed to find this answer. Every time I think I have gotten to the end of the internet, I am wrong.