Your code looks right. Maybe Arduino IDE 2 is getting in the way?
Here is my partitions.csv I'm using with an ESP32-S3. I shared instructions on how I created it at See instructions at: ReflectionsOS/Docs/Partition tables and optimizing memory in Arduino IDE.md at main · frankcohen/ReflectionsOS · GitHub
Espressif ESP32 Partition Table
for Reflections project,
GitHub - frankcohen/ReflectionsOS: Reflections is a hardware and software platform for building entertaining mobile experiences.
Name, Type, SubType, Offset, Size, Flags
nvs,data,nvs,0x9000,20K,
otadata,data,ota,0xe000,8K,
ota_0,app,ota_0,0x10000,3712K,
ota_1,app,ota_1,0x3b0000,3712K,
eeprom,data,153,0x750000,4K,
spiffs,data,spiffs,0x751000,128K,
coredump,data,coredump,0x771000,64K,