I'm working with STM32F411RE but I presume the problem is the same for any STM32F, and possibly others.
I couldn't find in the reference manual whether or not the RTC is halted during a debug session. For any other IPs, including those clocked with different clock sources like the watchdog IP, it's clearly mentioned that debug halting is configurable or at least the behavior is fixed and given.
What about the RTC ?