weighted mean with NA in weight vector

Please provide a small example of your case with e.g. 3 patients and 4 time-points that illustrates your case.
See reprex for how this could be done.

And probably you are aware that functions like sum and mean have an argument that can exclude NA values.
But I don't know if that would help in your case. Therefore my request for a reprex.