I see the problem. Your definition of a class is the set of all things equivalent to a given element. Your class generates the partition $\{1\}, \{2\}$
Note that your relation, although it generates the class, is not an equivalence relation. The equivalence relation for your partition is $a$ is equivalent to $b$ if and only if $a=b$.
The theorem states that a partition is the same as an equivalence relation. It does not say that if any relation generates a partition then that relation is an equivalence relation. In fact there are two separate theorems:
- If $R$ is an equivalence relation on a non-empty set $A$ then the set of equivalence classes forms a partition of $A$.
- Given a partition $P=\{A_1,\dots, A_n\}$ then the relation induced by the partition, $x$ is equivalent to $y$ if and only if $x$ and $y$ are in the same $A_i$, is an equivalence relation.
Therefore, the theorem that you wrote is incorrect.