Hi,
Regarding your question, we have the power_mode_switch example in SDK, pls download SDK package from the link:
https://mcuxpresso.nxp.com/en

For your issue, it appears that you use WKT to wake-up LPC802 from power-down mode, so pls check the WKT counter in debugger and check if the counter changes with time.
void Delay_Sleep1ms(int _1ms) {
#ifdef _DEBUG
Delay_Delay1ms(_1ms);
#else
LPC_WKT->CTRL &= ~(0x08 | 0x01);
LPC_WKT->CTRL |= (((uint32_t)(((uint32_t)(LOW_POWER_OSC)) << WKT_CLKSEL)) & 0x01);
LPC_WKT->COUNT = _1ms * 1000;
Delay_PowerDown(true);
WKT_INT = false;
#endif
}
It appears that you do not set SYSCON->SYSAHBCLKCTRL0|=1<<9;
Hope it can help you
BR
XiangJun Rong