You are correct.
Russell's Paradox exposed the inconsistency of a proposed formal set theory of his day. This so-called naive set theory allowed you to derive theorems of the form:
$\exists S: \forall a:[a \in S \iff P(a)]$ for any unary predicate $P$.
This was called the axiom schema of unrestricted comprehension.
For $P(a)\equiv a\notin a$, however, we could then prove to the contrary that:
$\neg\exists S:\forall a:[a\in S \iff a\notin a]$
The moral of the story: Just because you can "define" a set doesn't mean it actually exists. Some restrictions must apply.
These restrictions were described, at least in part, in the so-called axiom schema of restricted comprehension that replaced the above axiom:
$\forall X:\exists S: \forall a:[a \in S \iff a\in X \land P(a)]$ for any unary predicate $P$ where $S$ is not referred to in $P(a)$.
This eliminated the direct route to Russell's Paradox and plugged one hole in naive set theory. Various ways including effectively banning self-reference altogether (e.g. $x\in x$) were also introduced into set theory. This, it was hoped, would banish anything resembling Russell's Paradox for good.