I would use the angles, get the slope of the line as follows:
$$
\theta = \arctan\frac{y_B-y_A}{x_B-x_A}
$$
Then the coordinates of $A_2$ would be
$$
x_{A_2} = x_A+d \cos(90+\theta) \\
y_{A_2} = y_A+d \sin(90+\theta)
$$
When you are uncertain if your solution is correct, try to solve it using a different approach. Here is an example.
Another way to parametrise the line $\vec{v}(t)$ is to make $\vec{v}(0) = \vec{A} = (0, 1, 2)$, and $\vec{v}(1) = \vec{B} = (3, 0, 1)$, so
$$\vec{v}(t) = \vec{A} + t \left ( \vec{B} - \vec{A} \right ) = ( 3 t ,\;\, 1 - t ,\;\, 2 - t )$$
I parametrise my lines this ways very often, because otherwise I seem to get errors. In this form, it is trivial to check that $\vec{v}(t)$ passes through $\vec{A}$ and $\vec{B}$.
When a distance is minimized, distance squared is also minimized. The distance squared between point $\vec{v}(t)$ on the line and point $\vec{C} = (1, 2, 0)$ is
$$f(t) = \left ( \vec{v}(t) - \vec{C} \right ) \cdot \left ( \vec{v}(t) - \vec{C} \right ) = (3 t - 1)^2 + (1 - t - 2)^2 + (2 - t - 0)^2$$
i.e.
$$f(t) = 11 t^2 - 8 t + 6$$
Such an everywhere continuous and differentiable function reaches its extremum (a minimum or a maximum) at its stationary points where its derivative is zero:
$$\frac{d f(t)}{d t} = 22 t - 8 = 0$$
This is trivial to solve for $t$, and of course yields
$$t = \frac{8}{22} = \frac{4}{11} \approx 0.36\overline{36}\dots$$
We know from geometry of this particular case that if there is exactly one extremum, it must be the minimum. In this case, it means that $f\left(\frac{4}{11}\right)$ is the minimum distance squared, and that the point closest to $\vec{C}$ on the line is $\vec{v}\left(\frac{4}{11}\right)$.
Therefore, the minimum distance between the line and the point $\vec{C}$ is $\sqrt{f\left(\frac{4}{11}\right)}$, i.e.
$$\sqrt{f\left(\frac{4}{11}\right)} = \sqrt{\frac{16}{11} - \frac{32}{11} + 6} = \sqrt{\frac{50}{11}} = \sqrt{\frac{2\cdot5^2}{11}} = 5 \sqrt{\frac{2}{11}}$$
Thus, I agree with Michael Rozenberg. OP seems to have a bug in their calculations; the first one in the equation for the line.
Best Answer
Intuitively, you want the distance between the point A and the point on the line BC that is closest to A. And the point on the line that you are looking for is exactly the projection of A on the line. The projection can be computed using the dot product (which is sometimes referred to as "projection product").
So you can compute the direction vector $\mathbb{d}$ of the line $BC$. This is the difference of $B$ and $C$, divided by their distance:
$$\mathbb{d} = (C-B) / ||C-B||$$
Then you can define a vector from $B$ to $A$:
$$\mathbb{v} = A - B$$
Computing the dot product between this vector and the direction vector will give you the the distance between $B$ and the projection of $A$ on $BC$:
$$ t = \mathbb{v} \cdot \mathbb{d}$$
The actual projection $P$ of $A$ on $BC$ is then given as
$$P = B + t \cdot \mathbb{d}$$
And finally, the distance that you have been looking for is
$$|| P - A||$$
Of course, this could be written in a somewhat shorter form. It has the advantages of giving you exactly the closest point on the line (which may be a nice add-on to computing only the distance), and it can be implemented easily. Some pseudocode: