You’re getting tricked by the fact that PlatformIO in the standard espressif32 platform still uses Arduino-ESP32 2.0.16 as its Arduino core. (due to politics).
As you can see per
the function timerBegin takes 3 arguments in Arduino-ESP32 2.0.16, but, in Arudino-ESP32 3.0 you have
A changed API in which that function only uses one argument.
Thus, you can either rewrite the code to use the Arduino-ESP32 2.x API and keep platform unchanged, or, make PlatformIO use Arduino-ESP32 3.x by using unofficial platforms or packages. See