I narrow down the issue. The controller is restarting due to "Stack Overflow".
line number 220 code is causing the issue,
reschedule = timer->callbackPtr(timer->payload);
It looks like its a recursive which causing the issue but, I was not able to understand the part of the code how it works in a given time.
We tried by adding "NULL" pointer check to that line that worked but, I feel like as an application or function of API it may not but, it just saves from restarting the controller.
if(timer->callbackPtr != NULL)
reschedule = timer->callbackPtr(timer->payload);
I have attached the snapshot of the StackOverflow Flag setting.
BTW. looks like its a simulator bug on showing nMLCR bit has low every time. I tested the voltage on the nMLCR it's not low nor dropping while executing the program.