Does this happen with the simplest possible sketch too?
#include <Arduino.h>
void setup() { Serial.begin(9600); }
void loop() { Serial.println("Test"); delay(1000); }
?
If yes, have you tried setting dtr/rts to 0/1 like Noob stuck on ESP32-CAM+MB with PIO/vscode - #5 by maxgerhardt shows?