We checked the issue again with RTC enabled in MQX (RTCDEV=1) but not initialized in the main program. The reason for "why 530ms"? is still not much clear to us, but we did a power sequence to know more.
The power sequence is attached. We are first applying:
(1st cycle-State 0) 3.3V to VBAT pin -> (2nd cycle-State 1) introducing 5V (for 5V to 3.3V LDO) to generate uC's 3.3V -> (3rd cycle-State 2) continuing 3.3V and removing 5V -> (4th cycle-State 3) continuing 3.3V and again introducing 5V. We have selected the time as 4secs for each cycle at random.
The observation is that the first time VBAT gets power, the VBAT POR will be generated, so during the first two cycles we are getting approximately 500ms delay in GPIO toggling for the reason unknown. However, during the 3rd and 4th cycle, VBAT is continuously powered, but the reset of uC power might be clearing some RTC fault, so in this case we are getting ~30ms time.
It is now understood that in the first case VBAT POR will be asserted so we are getting some delay, and also that we don't get 500ms delay in subsequent cycles where 5V may be powered off to on but VBAT is continuously powered.
The exact reason for "500ms" still remains unknown. It could be RTC fault time, some POR delay, interrupt related, etc. but we are not sure.