Hi Johan,
Do you operate the CPR area, it is in flash address 0x2fc.

I don't know whether use CRP3, if yes, your chip will be secured to the highest level, you can't disable it.
Now, I think you can enter UART ISP mode, then use FlashMagic to connect the board.
If you can connect the board, then erase all the flash area at first, then connect the JTAG again.
But, if you even can't connect the chip with UART ISP, I am afraid you secure the chip to highest level, that situation, you can unsecure it again.
Wish it helps you!
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------