Yes, fork arduino-esp32 and use platform_packages
to change the source of framework-arduinoespressif32
to your fork with the fixed files.
But you should first make sure the check if
- the bug is fixed or not in the bleeding edge Arduino-ESP32
- can also be used in PlatformIO as per e.g. ESP32-Arduino - platformio support for 2.0.0 version
- if not, open an issue there