Yes, Cube autogenerates a lot of code and will overwrite things that don’t follow the inserted markers.
The original article even includes an example of using Cube to configure the clocks and then use those configurations together with Rust.
I agree that it isn’t ideal at all and kinda wonky. But more links in the datasheets would be nice.