Esp32 crashing when trying to open file in FreeRTOS task

What SD support are you using? SD.h only supports 8.3 style 11 character names. You need to use SdFat.h for long name support.
https://docs.arduino.cc/libraries/sdfat/