strange anomaly with DS3231

I've been having a strange anomaly going on in a project using one of those small DS3231 modules like the below...

The way I use this module is simply for time of day. I read hours, minutes, and seconds consecutively in a typical I2C sequence where multiple registers are read. I do this about once every 2 seconds, since the project only needs accuracy to the minute. The problem seems to be that about once a month (which may be a clue), My I'll look at the time (displayed on an I2C LCD display) and I'll see that I've lost or gained an hour. (There is never an error in my minutes display). Thinking it was an I2C error that I was somehow missing, I modified the project to always read these time elements twice, and only believe it when I see hours and minutes equal in 2 successive reads. That didn't help.

Its a complex project, too long to post, and I'm aware of many possible ways I could have a coding error and will debug accordingly. But I thought it wouldn't hurt to ask:

  • Could there be a simple procedural flaw in my dealing with this chip that could be causing this? For example, when I set the time I never set day of week, calendar day, year, or any alarm options. And as far as I know the only "configuration" I'm doing is to make sure I'm reading 24 hour time.
  • Are there any known "bugs" or "gotcha's I've missed that could cause such hour read errors?

If not, I'll just keep snooping with debug outputs and hopefully isolate exactly what conditions seem to make this happen.

Just post the following clock related codes:

1. Library file used.

2. Codes under setup(); including the code to set initial 24 hr time of the day.

3. Codes under loop() to--
acquire time of the day
codes to implement 2-sec delay which must be from the RTC's elapsed time and not using delay(2000) function.

@GolamMostafa I appreciate you volunteering to debug the code, but I can do that.If the error is due to my code then eventually one of my DEBUG prints to the serial monitor will catch the conditions when it occurs, and I'll eventually fix it. It wouldn't make sense for me to attempt to extract every bit of relevant code that is mine from the project and post it anyway. But while I'm troubleshooting I was looking for anyone who knew of an anomaly in the chip itself, which may be either a bug, or in documentation I've missed. I mean something crazy I'd never have guessed, and would not be a simple programming error. For example, if the RTC was subtracting an hour thinking I was crossing into daylight savings time, because I had failed to set a month and avoid February. That's not the case here, but that's the kind of thing I'm looking for... something about the chip itself that I may be inadvertently causing, by NOT setting something I didn't think mattered.