In the set theory of NBG, the class existence theorem says that for all predicative well formed formulas $\varphi$ (wff's in which the variables quantify only over sets) there is a (unique up to extensionality) class, $A$, such that if $x_1, x_2, ..., x_n$ are the free variables of $\varphi$ then the universal closure of $(x_1, x_2, ..., x_n) \in A \iff \varphi(x_1, x_2, ..., x_n)$ is true.
So in some sense we "can" define a function that takes as a parameter a predicative wff, let's call it $\varphi$ and outputs the unique class such that the universal closure of $(x_1, x_2, ..., x_n) \in A \iff \varphi(x_1, x_2, ..., x_n)$ is true.
But we can sort of define an inverse function, call it $g$. For each class $A$ define $g(A)= "x \in A"$. And now one can see that $g$ is "injective". So in some sense, the cardinality of the whole classes is less that that of the predicative wff's, which the latter is clearly at most countable. And this result looks like a contradiction, like wouldn't it imply that the Von Neumann universe is at most countable?
I feel like there is a huge flaw in my reasoning such that I am making my function $g$ that operates on objects of the language($A$, the classes) and outputs objects in the metalanguage(predicative wff's).
Can someone explain the flaw in this reasoning? I possess a limited understanding of formal logic and the axiomatic set theory of NBG, without reaching an advanced level of expertise.