ESP32, serial library suddenly stopped to work

The ESP32 S3 has UART to Serial and native USB Serial.

The Serial object is controlled by the compiler flag ARDUINO_USB_CDC_ON_BOOT

ARDUINO_USB_CDC_ON_BOOT = 1 the output of Serial is routed to the native USB port
ARDUINO_USB_CDC_ON_BOOT = 0 the output of Serial is routed to the UART port.

This corresponds to the ArduinoIDE setting “USB CDC on Boot”.

For details see ESP32-S3 native USB interface and Serial Monitor missing first messages - #10 by sivar2311

The esp32-s3-devkitc-1-n16r8v.json is not part of the official espressif32 platform and must be a custom one. Please show the content of this file and the content of your platformio.ini to determine the settings for ARDUINO_USB_CDC_ON_BOOT.