Inserting digits to satisfy equation
JavaScript (ES6), 164 bytes
Thanks to @l4m2 for identifying several bugs and suggesting the alternate version below

(x,y,z)=&gt;(F=k=&gt;(g=(k,s=z+`-${x}-`+y,n=9)=&gt;eval(s.replace(/\d+/g,'&quot;$&amp;&quot;'))?k&amp;&amp;[...s,0].some((_,i)=&gt;g(k-1,s.slice(0,i)+n+s.slice(i)))||n&amp;&amp;g(k,s,n-1):1)(k)?k:F(k+1))(0)

Try it online!
How?
We build the string s with the pattern z-x-y and recursively attempt to insert k additional digits until eval(s) is 0.
Commented
(x, y, z) =&gt; (                 // main function taking (x, y, z)
  F = k =&gt; (                   // F is a recursive function taking a counter k
    g = (                      // g is a recursive function taking:
      k,                       //   k = number of digits to insert
      s = z + `-${x}-` + y,    //   s = expression string &quot;z-x-y&quot;
      n = 9                    //   n = next digit to insert
    ) =&gt;                       //
    eval(s.replace(            // if the expression does not evaluate to 0:
      /\d+/g, '&quot;$&amp;&quot;'           // (add quotes to prevent any number with a
    )) ?                       // leading 0 to be parsed as octal)
      k &amp;&amp;                     //   if k is not equal to 0,
      [...s, 0].some((_, i) =&gt; //   for each position i from 0 to len(s):
        g(                     //     do a recursive call to g:
          k - 1,               //       decrement k
          s.slice(0, i) + n +  //       insert n at position i
          s.slice(i)           //       (and implicitly restart with n = 9)
        )                      //     end of recursive call
      ) ||                     //   end of some()
      n &amp;&amp;                     //   if n is not equal to 0:
        g(k, s, n - 1)         //     do a recursive call to g with n - 1
    :                          // else:
      1                        //   success
  )(k)                         // initial call to g with the current value of k
  ?                            // if successful:
    k                          //   return k
  :                            // else:
    F(k + 1)                   //   try again with k + 1
)(0)                           // initial call to F with k = 0


JavaScript (Node.js), 158 bytes
A slower but 6 bytes shorter variant suggested by @l4m2

(x,y,z)=&gt;(F=k=&gt;(g=(k,s=z+`-${x}-`+y,i=~s.length*-10)=&gt;k*i--?g(k-1,s.slice(0,t=i/10)+i%10+s.slice(t))|g(k,s,i):!eval(s.replace(/\d+/g,'&quot;$&amp;&quot;')))(k)?k:F(k+1))(0)

Try it online!