No, we're replacing finite oil and gas with other finite resources. Sun and wind require hardware to be converted into usable energy, that requires finite materials.
Sun and wind also require massive energy storage solutions to replace the ease of storing energy in the form of oil. Again that energy storage requires finite materials to make, maintain, and replace as they degrade.
We can absolutely find ways to optimize resources we already have and find new uses for resources, but we can't make resources out of thin air.