No we don’t have to replace all fossil primary energy.
We only have to replace the useful energy with clean energy using much more efficient technologies.
We don’t need to replace the wasted fossil energy. We can avoid the inefficiency in the first place.