Please post more details on your case (share the entire debug log), so that it will be easier to understand the root cause.
Otherwise, I advise you to check the Debug configuration in the CubeIDE and make sure to select the adequate external loader. Check also your board stack size.
"When your question is answered, please close this topic by clicking ""Accept as Solution"".ThanksImen"