James Gunn started writing 2025's Superman: Legacy months before Henry Cavill returned as the Man of Steel in Black Adam. Cavill's last appearance as Superman in theaters had been the ill-received 2017 Justice League before the actor returned to the role last October in a cameo alongside The Rock in Black Adam. Initially, Cavill celebrated the occasion, only for it to be revealed two months later that he would not continue in the role. Gunn is rebooting Superman for the DC Universe, but it appears the movie was in development before Cavill even returned.
https://screenrant.com/james-gunn-dcu-universe-superman-hiring-timeline/