Some problems ask for queries on edges, not vertices. Each edge connects a parent to a child. Store the edge value at the child node in this case. When querying a path for edge values, exclude the LCA from the query. The LCA is a vertex, not an edge on the path.
Include the LCA only for vertex queries. This distinction changes the query logic slightly. For edge queries, when both nodes are in the same chain, query from the deeper node to the LCA plus one position, excluding the LCA itself.