Hi @rtalan
What you describe could be caused by the corrupted Arduino bootloader!
I don't know but I see that in the official github repo there are different versions that operate in USB FS or HS. https://github.com/arduino/ArduinoCore-mbed/tree/main/bootloaders/PORTENTA_H7
As the code is not available, could you ask to the Arduino community for help?

I don't have the hardware diagram of the Portenta H7 but I assume that their bootloader firmware configures the internal SMPS then the clock of the STM32H747I to ensure correct boot sequence.
As the product is a dual core CPU (M7+M4) perhaps you have disabled the Cortex-M4 boot in the byte options? Can you check with STM32CubeProgrammer the status of the BCM4 option byte?
For the definition of the thread linker memories of your CubeIDE project, it seems safe to me and will not overwrite your bootloader. From this side it's ok.
Finally, it's good news if you managed to debug your code on the CM7. However, the following line of code is mandatory in the case where the CM4 is also used because it allows you to wait until this second CPU is properly started.
while((__HAL_RCC_GET_FLAG(RCC_FLAG_D2CKRDY) != RESET) && (timeout-- > 0));
I suggest you the application note AN5361 which explains how to program and debug a dual core project on the STM32H7 with STM32CubeIDE:
https://www.st.com/resource/en/application_note/an5361-getting-started-with-projects-based-on-dualcore-stm32h7-microcontrollers-in-stm32cubeide-stmicroelectronics.pdf
Best regards,
Romain,