Please provide a minimal code to reproduce the error.
Arduino 3.x has some breaking API changes. See Migration from 2.x to 3.0 - - — Arduino ESP32 latest documentation
Especially the ledc API has changed.
Did you perform a “Full Clean” after switching to Arduino 3.0.1 ?
Otherwise there might be some Arduino 2.x leftovers.
Meanwhile Arduino 3.0.2 has been released:
platform_packages=
framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#3.0.2
framework-arduinoespressif32-libs @ https://github.com/espressif/arduino-esp32/releases/download/3.0.2/esp32-arduino-libs-3.0.2.zip
Please note that Arduino 3.x is not (yet) officially supported by PlatformIO.
Hence the question: Does the problem also occur with the ArduinoIDE?