Hello chaitanya Kulkarni,
If everything is ok in the hardware then the problem is that you are not initializing the RTC again when you disconnect the system supply and Vbat. I took the the example periph_rtc of the LPCOpen mentioned before (LPCOpen Software for LPC40XX|NXP).
I modified the example to initialize the RTC and set the default hour and date when necessary. To know when I have to initialize the RTC I checked the bit '1' in the CCR register (Clock Control Register) using software. Please see image below, to understand why the bit 1 in the register CCR.

In the example, I added an if condition to check if the RTC need to be initialized then I call the function RTC_INIT and I set the default date and hour. If the RTC is enabled then I do nothing and continue with the program normally to avoid loosing the count of the RTC.
if( (LPC_RTC->CCR & 1) != 1)
{
Chip_RTC_Init(LPC_RTC);
Chip_RTC_SetFullTime(LPC_RTC, &FullTime);
}
In the next image you can see the results of running the program.

Hope it helps!
Victor.
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------