I understand that the registers are write protected and you have a clock synchronization issue, but I can not find the cube HAL level calls to do this.
I am using the HAL_RTC_SetTime(&hrtc, &stimestructureput, RTC_FORMAT_BIN); which says it is doing these steps but it is failing to get the RTC back in init mode so the value can be changed.