Mistake : Forgetting to handle the case where one node is an ancestor of the other. If is an ancestor of , then . Check for this after equalizing depths.
Mistake : Using up[u][i] == up[v][i] as the condition to jump both nodes. You should jump when up[u][i] != up[v][i]. Jumping when ancestors match overshoots the LCA. Only jump when ancestors differ, so you stop just below the LCA.
Mistake : Not accounting for -indexing vs -indexing. If nodes are -indexed, adjust your table and array so.