We have seen sporadically electrical damages on the JTAG/SWD port pins by connecting JTAG debugger boxes.
If you have supplied the board and the JTAG debugger by different switch power supply domains, there might be a huge difference in the electrical potential.
With the physical outline of a JTAG connector it is not guaranteed, that the GND pins are connected first, so it could well be that 2 signal pins get connected first which have a difference in potential of several 100V. For a very short time there is a peak current which could destroy a JTAG/SWD input pin. Nothing you could really avoid, only something which you can protect against.
For boards getting connected to debuggers regularily, we recommended to add protection diodes to the JTAG/SWD input pins. Or you alway connect the debugger to the board before you connect it to power.
If you stiill can access with the ISP mode using the UART interface, but can't connect with JTAG/SWD anymore, then most likely you deal with this issue.
Regards,
Bernhard.