The RTC irq_handler of the latest nRF5 SDK may cause potential problems.
Imagine someone trying to extend the RTC timer from 24bit to 32bit, the developer has to keep an extra byte and increment the overflow on overflow event.
The current implementation irq_handler fires COMPARE event before fires OVERFLOW event, which potentially may cause failure for timer longer than 512 seconds.
It may happen only if the code happens to be waiting on comparison of 0!
I would suggest a code change on your side. As a safe guard, I will check NRF_RTC_EVENT_OVERFLOW in my code on compare and perform increment and clear event.
Also, I would like a confirmation from your hardware team, that if the code is waiting on tick 0, the OVERFLOW and COMPARE event will be guaranteed to be fired together, or at least OVERFLOW shall be fired before COMPARE.
Cheers
Qingjun