Well scientists dont know much. The theory of earth and other planets forming from a solar disk is still a theory and as such is not proven by any means. There are other possibilities. Also since most stars go through cycles of nucleogenesis which is how all elements other than hydrogen and helium are formed in the first place. So when a star ends its life most of the atoms will be oxygen, carbon and iron. Sheer proximity would allow water to form in massive quantities.
“Sheer proximity would allow water to form in massive quantities.”
Your theory.
“Allow” is not the same as “cause” as the cause - all the right conditions, requires more than “sheer proximity”.