Let $A,$ $B,$ and $C$ be constants such that the equation \[\frac{(x+B)(Ax+28)}{(x+C)(x+7)} = 2\]has infinitely many solutions for $x.$ For these values of $A,$ $B,$ and $C,$ it turns out that there are only finitely many values of $x$ which are not solutions to the equation. Find the sum of these values of $x.$
If the given equation is true, then multiplying by $(x+C)(x+7)$ gives the equation \[(x+B)(Ax+28) = 2(x+C)(x+7),\]which must also be true. (Note however, that the converse does not hold: that is, by multiplying by $(x+C)(x+7),$ we may have introduced extraneous roots.) Therefore, the above equation must also have infinitely many roots for $x.$ That is, the polynomials $(x+B)(Ax+28)$ and $2(x+C)(x+7)$ must agree for infinitely many values of $x.$ This means that they must be identical polynomials. (In general, if $p(x) = q(x)$ for infinitely many $x,$ then $p(x) - q(x) = 0$ has infinitely many roots, which is only possible if $p(x) - q(x)$ is identically the zero polynomial.)

This means that \[(x+B)(Ax+28) = 2(x+C)(x+7)\]for all $x.$ Expanding both sides, we get \[Ax^2 + (AB+28)x + 28B = 2x^2 + (2C+14)x + 14C.\]Corresponding coefficients of both sides must be equal, so we have \[\begin{aligned} A &= 2, \\ AB+28 &= 2C+14, \\ 28B &= 14C. \end{aligned}\]From the first and third equations, $A=2$ and $C=2B.$ Then substituting into the second equation gives \[2B+28 = 4B+14,\]so $B=7,$ and then $C=14.$ This means that our original equation was \[\frac{(x+7)(2x+28)}{(x+14)(x+7)} = 2.\]This equation holds whenever the denominator is nonzero. The denominator is equal to zero when $x=-7$ and $x=-14,$ so the sum of the values of $x$ which are not roots of the original equation is $(-7)+(-14) = \boxed{-21}.$