Let's check whether the candidate set $A=\{\{1,2\},A\}$ is a ZFC set. To qualify as such, it has to comply to all the ZFC axioms, including regularity/foundation (which determines whether a set is well-founded).
From the definition of the candidate set $A$, we infer that $A\supset \{A\}$. This means that every element of the latter is an element of the former. Thus, $A\in A$.
However, $A\in A$ violates the axiom of regularity/foundation, since it has been proven in the literature that no well-founded set is an element of itself.
Therefore, the candidate set A is not a well-founded set, which implies it is not a ZFC set. $\blacksquare$
Now, what was the flaw in the original poster's proof attempt?
It is made clear when we consider ZFC as an axiom system, not as a single axiom taken in isolation.
Let's look at the interaction between two axioms from ZFC.
The axiom schema of specification/separation/restricted comprehension/subset insures that every subset of a ZFC set is a ZFC set. That is, due to the axiom schema of specification, we are told that all the ZFC axioms automatically succeed all the way down (if ZFC is consistent).
But the original (super)set must be a ZFC set for this insurance to be provided by the axiom schema. Otherwise, no guarantees apply.
Thus, if you assume a candidate set is a ZFC set, then, when you take a look at its subsets, every subset must also be a ZFC set. Contrapositively, if at least one subset is not a ZFC set, then the superset is not a ZFC set either.
The subset$^{(a)}$ $\{A\}$ from the candidate set $A$ is not a ZFC set because $A \in A$ (which violates the axiom of regularity/foundation). The subset has the (super)set as an element. Thus, since the candidate set $A$ has a subset that does not comply to a ZFC axiom, then $A$ cannot be considered as a ZFC set, by the (contrapositive statement of the) axiom schema of specification.
If we had reasons to be assured that all the subsets of candidate set $A$ were ZFC sets, then the original poster's proof attempt would have worked. But we were not assured this to begin with. Indeed, the proof (above) showed that $A$ (which has a subset $\{A\}$) is not a ZFC set. A subset violated the axiom of regularity/foundation, thus, by the axiom schema of specification (in contrapositive form), $A$ is not a ZFC set.
Employing the axiom of regularity/foundation to prove whether a candidate set complies to it is not the most common use case; more often, we employ this axiom as an additional fact/premise to obtain an interesting consequence from sets we already know to be ZFC sets. For instance, if $b$ and $c$ are ZFC sets and $b\in c$, then, by applying the axiom of pairing and the axiom of regularity/foundation as additional facts, we have the tools we need in order to prove that $c\notin b$.
$_{(a)}$ Obtained by the implicit application of the axiom schema of specification in the proof above.