Hi @Wangerxi
Thank you for letting me know.
In that case , yes it could be the case that you have bricked the MCU.
At the first sector of the flash there is field at 0x400 , containing security settings. Specially at 0x40C offset there is a byte called FSEC, normally it has to be written with ones ; it contains critical fields controlling Security and mass erase enable that if they are written with zeroes, they will protect the MCU.
You did not necesarilly bricked for ever the MCU. If you only enabled security you could disable it back, regaining debug access. But if you also disabled the Mass erase, you will not be able to recover the MCU with the SWD/ JTAG or any external interface.