Ampere's law and external currents

The value of the line integral $\oint_C \vec B \cdot d\vec l$ really does only depend upon the current bounded by the closed path $C$. That's a consequence of Ampere's law. However, the value of the magnetic field $\vec B$ at any point along the path $C$ depends on every current, even those outside. Knowing the value of the line integral is not the same thing as knowing the value of the magnetic field.

Here's an example that illustrates the difference:

Imagine just a single wire carrying current $I_o$. Take the Amperian to be a circle that encloses the wire but is not centered on it. By Ampere's law, $\oint_C \vec B \cdot d \vec l=\mu_o I_o$. Done and done. However, you can't use this Ampere's law to "factor out" $\vec B$ from the integral, so you can't use it to solve for $\vec B $. Why? Because the magnetic field isn't constant over the path, and since it's not constant, it can't be pulled out of the integral in the manner you normally would. In order to rewrite $\oint \vec B \cdot d\vec l$ as $B \oint dl$, one requirement is that the magnitude of the magnetic is constant over the path.

One more example.

Imagine two wires that each carry current $I_o$, but the Amperian loop is centered around only one of them; the other wire is not bounded by the loop. Alright, here again, $\oint \vec B \cdot d\vec l = \mu_o I_o$. Done. But the magnetic field $\vec B$ in the integral is really the net magnetic field $\vec B_\text{net}$. As mentioned earlier, all currents contribute to the magnetic field $\vec B$ in Ampere's law. But since the net magnetic field isn't constant, you can't factor it out of the integral and solve for it.

So the Ampere's law as you know it is mainly useful when you can factor out the magnetic field and solve for it. In these cases, you typically have highly symmetric situations that allow you to do this. But even in non-symmetric cases, Ampere's law is true, but doesn't allow you to solve for the magnetic field.