Once the RTC clock source has been selected, it cannot be changed anymore unless the Backup domain is reset, or unless a failure is detected on LSE (LSECSSD is set). The BDRST bit can be used to reset them.
Examples
LL_RCC_SetRTCClockSource() is referenced by 5 libraries and example projects: