STM32 & ST-LINK - SWD connector not working
The SWD connector on a Discovery board (CN2) is not for programming the on-board Target MCU.

Rather, it is to allow the on-board ST-LINK to be used to program an external target.

If you want to program the on-board target with a different programmer, you will need to study the schematics, find all the relevant signals, and make sure the on-board programmer is not loading the lines - which sounds to be about what you did in picking up the SWD pins from their GPIO breakout positions.

From looking at the schematics, it looks like as if with the CN3 jumpers removed, the Target SWCLK should be available on CN3-2 and its SWDIO on CN3-4.  But pins 1 and 3 of that connector are not power and ground - rather, they are the on-board programmer's versions of these signals arriving at the jumper positions.