297. PC13 (or other RTC-related pin) does not work in non-RTC-related function, when RTC used
In most if not all STM32, PC13 has several functionalities related to RTC, e.g. alarm output, calibration output, tamper/timestamp input. These functionalities are set up in RTC registers, and these settings are documented in the RTC chapter of RM.
What may be surprising, is, that if PC13 is set to some of these functionalities, these override the GPIO setting of given pin. Such setting may occur also inadvertently through the same mechanism, as when RTC is set surprisingly into the AM/PM mode, usually due to uninitialized struct when using the Cube/HAL function to set RTC time.
In some STM32, there are also other pins, which can be overriden in this way, e.g. PI8.