# TikZ: Bug (?) with .pic: misalignement of nodes

I am using .pic to use a same picture several times. I noticed a difference of behavior between the same code inside a .pic or outside. In the example below, one can notice that within a .pic, the node on the edge is not at the place it should be.

\documentclass{standalone}
\usepackage{tikz}
\tikzset{thepic/.pic = {\draw (0, 0) edge node {0} (1, 0);}}
\begin{document}
Without \texttt{.pic}: \tikz{\draw (0, 0) edge node {0} (1, 0);}
With \texttt{.pic}: \tikz{\pic{thepic};}
\end{document}


The result

Is this a (known) bug?

• Better picture provided. I also checked with the article class also defining the pic after \begin{document}, just to be sure: the result is the same. – egreg Nov 10 '16 at 13:37

I don't know the cause for this problem, it's probably related to the path construction with .pic. But if you explicitly say that the node should be in the path midway it works normally:
\documentclass{standalone}