Finding the longest path in an undirected node-weighted tree
No, your algorithm does not work sometimes.

Here is a counterexample. Let graph $G$ have five weighted nodes, $A\mapsto 1$, $B\mapsto -1$, $C\mapsto 0$, $D\mapsto 1$, $E\mapsto 1$. There are four edges, $AB$, $BC$, $CD$ and $CE$.

Let us run your algorithm. 


Select node $B$ and run DFS($A$). We may get the maximum weight simple path $B, A$, whose weight is 0.
Run DFS($A$), we may find the maximum weight simple path that starts at $A$, which is $A, B, C, D$, whose weight is 1. That path is returned.


However, the simple path with the maximum weight is actually $D,C,E$ whose weight is $2$.