First of all, note that the P&E plus the debugger may put your chip in stop mode, and when it does that, the watchdog is stopped as well. So if you pull out the BDM in runtime, the chip might hang in stop mode.
If that isn't the cause of the problem, it is most likely related to the watchdog settings. Make sure you are enabling the watchdog and that you have the watchdog interrupt pointing at the right place from the interrupt vector table.