Expressing the condition as a set of linear constraints
Let us instead translate $x=0 \leftrightarrow y=0$ into disjunctive normal form. We would get

$$ (x=0 \wedge y=0 ) \vee (x&gt;0 \wedge y=1) \vee (x&lt;0 \wedge y=1) $$

Each conjunction is a linear constraint.

In your solution you assumed that the constraint $y=1 \vee x=0$ is always true. In fact $y=1 \vee y=0$ is always true, since this is the domain of $y$.

If you kept this constraint, you would have eliminated solutions where $y=0$ and $x \not= 0$.

Another issue is with your interpretation of the constraints. The pair 
$$
\begin{array}{c}
-M &lt; x &lt; 0\\
y=0
\end{array}
$$
is a set of two constraints not a single constraint, therefore it is satisfied by the following 19 pairs
$(-5,0),...,(8,0),(-5,1),...,(-1,1)$. The first 14 pairs clearly violate the condition $x=0 \leftrightarrow y=0$.