I was able to recover my device by following these steps.
1. You need to ensure that your VDD doesn’t get interrupted. For this place the JP4 from 5V_STLK to 5V_UCPD (5V_UCPD provided by a host PC connected to CN15 through a USB Type-C® cable)
2. Connect the normal CN17 through a USB Type-B® cable (as usual)
3. Take a male to male connector and provide 3V3 power source from your PMOD Pin 6 to a common point between R32 and R33
4. connect via STM32CubeProgrammer and ensure you remove TZEN=0 inOption bytes and put the
RDP level 0 and then apply, mass erase and then your MCU is ready to use now.

Note that you need to do this simultaneously, unplug and plug in JP4 to 5V_UCPD and in other hand keep the 3V3 on the common point between R32 and R33. This will ensure you are in RSS/Bootloader mode and connect via STM32CubeProgrammer