If I understand it correctly, you'd want to know why your solution fails and when you can't use the discriminant method.
The definition of the discriminant of a polynomial $$p(x)=a_nx^n+...+a_1x+a_0$$
requires, for algebraic reasons, that the degree of $p(x)$ is precisely $n$, that is $a_n\neq0$ .
In your problem, the polynomial is $$p(x)=(y-1)x^2+3yx+2y+1 . \tag{1}$$
So, when we reach the point 3 of your solution, we have to split it into 2 cases.
The first one, $$a_n=a_2=y-1=0,$$ must be examined without using any discriminant argument (or, more precisely, we could use linear polynomial discriminant argument, but it should be useless because it's always equal to 1 and, so, it doesn't depends on the coefficients of $p(x)=3x+3$).
In this case, we have $$y=1\implies x=-1,$$ the latter of which is not in the domain of $f$.
So, even if $y=1$ is a valid value for the parameter $y$ in the equation $p(x)=(y-1)x^2+3yx+2y+1=0$, that gives $x=-1$ as solution, we have that: $$(-1,1)\notin \{(x,y)\in\mathbb{R}^2:y=f(x)\} ,$$ and then $y=1$ is not in the range.
In the second case,
$$a_2=y-1\neq0,$$
we can use your discriminant argument, but remembering, in the end, to check if the solutions we obtain are compatible with the initial costraints, i.e. the domain of $f$.
Let's say $D_y$ is the discriminant of $p_y(x)$, where we use the subscript $y$ because both depend on $y$.
We found that $$\forall y,D_y\geq0$$
which means that, for each value of $y$, we have at least a solution $x$ for $p_y(x)=0$.
In other words, we found that
$$S=\{y\in\mathbb{R}:\exists x:p_y(x)=0\}=\mathbb{R}.$$
Let's say $T$ is the range of $f$.
We know that $T\subseteq S$, but we don't know if $S\subseteq T$:
picking $y_0\in S=\mathbb{R}$, we have that $$\exists x_0:p_{y_0}(x_0)=0$$
but, before saying that $y_0\in T$, we have to check if $x_0$ is in the domain of $f$, that is $x_0\ne-1 \land x_0\ne-2$.
For example, if $y=-2\in S$, we have that $$p_{-2}(x)=-3x^2-6x-3=0$$ has one solution that is $x=-1$, but $f$ is not defined in $-1$, so $-2\notin T$ (incidentally, this is the only example we can produce, but we don't know yet).
Ignoring the example, we need a way to identify all values $y$ such that $p_y(x)=0$ has the solution $x=-1$, or the solution $x=-2$, or the couple of solutions $(x_1,x_2)=(-1,-2)$.
Setting $x=-1$ in $p_y(x)=0$ we have an identity, so there is nothing we can say.
Intead, setting $x=-2$ in $p_y(x)=0$ we have $-3=0$, and this means that there are no chances that exists an $y$ such that $p_y(x)=0$ has a solution $x=-2$.
So, the residual problem is to identify all values $y$ such that $p_y(x)=0$ has the only solution $x=-1$.
How can we handle this case?
We know that $p_y(x)=0$ has one solution if and only if $D_y=0$, that is $y=-2$.
In this scenario, we have, as seen before:
$$p_{-2}(x)=-3x^2-6x-3$$
and then
$$p_{-2}(x)=0 \iff x=-1$$
So, we can conclude that $y=-2\in S$ but $y=-2\notin T$.
Summarizing what precedes, we can say that:
$$T=S\setminus \{1,-2\}.$$