That simple: debugger is running normally, but when the code gets a call to I2C_TransferInit() it disconnects, power cycle actually.
I can't find anything in the docs referring to SWD and I2C overlapping internally. I'm routing I2C to location 4.
I suggest you try the blinky code first if you could still see the issue happen.
If you have issue only with your code, it is better for you to provide the schematic and your code.