Hi @flesky
Thank you for letting me know,
Check that your application firmware do not have any configuration in the flash configuration settings. They are described in the following post How (not) to Secure my Microcontroller ( I am not sure if you are getting this error only with several boards of your batch , or if all of them are failing)
Regarding physical connection , check that the PINs corresponding to SWD do not have any other functionality, , or that they are not muxed to be digital pins for example.
Depending on your IDE and available debuggers in your workbench there are other procedures that may help .For example, the MCUxpresso IDE has the GUI Flash tool that lets you resurrect locked MCUs by overwriting the memory contents of at the 0x400 offset.

(The GUI Flash tool supports Segger, CMSIS DAP and PE- Micro debug probes)
My apologies for the delay (unfortunately I had missed your reply)
Let me know your findings.
Diego.