You faced overflow issue. Since time tick function is 32 bit type, system couldn't generate next call time properly.
Is there any time tick function for 64 bit, then you can fix the issue.
the tick function should not cause the overflow because it is a uint32_t, which goes to 0 after overflow.
Yes, if the timefunction back to 0, the next call time and current time would be corrupted.
Therefore, we are using 64bit time function.