There is nothing wrong with this remedy which is intended to make the hair grow and to treat hair loss. And that will not have any impact on the validity of your wudoo', so you can wipe over your head along with any hair, old or new. Your prayer will also be valid, praise be to Allah.
For more information, see the answer to question no. 47664
And Allah knows best.
Reproduced from Islam QA