Thevenizing a Circuit when current through load is a paramter
I think, you've already worked out what went wrong. But nodal is the "go to" approach. (I've grounded the bottom node, mentally, so it's voltage is arbitrarily set to zero.) Nodal analysis has:

$$\begin{align*}
\frac{V_A}{40\:\Omega}+\frac{V_A}{10\:\Omega}&amp;=6\:\text{A}+\frac{0\:\text{V}}{40\:\Omega}+\frac{V_B}{10\:\Omega}\\\\
\frac{V_B}{10\:\Omega}+\frac{V_B}{20\:\Omega}&amp;=4\cdot\frac{V_A-V_B}{10\:\Omega}+\frac{V_A}{10\:\Omega}+\frac{-30\:\text{V}}{20\:\Omega}
\end{align*}$$

This is two equations in two unknowns and solves out as \$V_A=168\:\text{V}\$ and \$V_B=150\:\text{V}\$. From that, the current \$i\$ is trivial: \$i=\frac{168\:\text{V}-150\:\text{V}}{10\:\Omega}=1.8\:\text{A}\$.