Real Volume
$$
\text{Real volume} \neq V- \mathrm{b}
$$
You need to solve the van der Waals gas equation to obtain the real volume.
Compressibility Factor
According to your definition of compressibility factor $Z$:
$$
Z = \dfrac{V_\text{real}}{V_\text{ideal}}
$$
and not the other way around; $Z \neq \left( \dfrac{V}{V-n\mathrm{b}} \right)$.
The van der Waals (Real) Gas Equation
$$
\left( P_\text{real}+\dfrac{\mathrm{a}n^2}{V_\text{real}^2} \right) \left( V_\text{real} - n\mathrm{b} \right) = n\mathrm{R}T \tag{1}$$
where $P_\text{real}$ and $V_\text{real}$ are the pressure and volume of the real gas, $n$ is the number of moles of gas particles, $\mathrm{a}$ and $\mathrm{b}$ are the van der Waals gas constants (which depend on the gas), and $\mathrm{R}$ is the universal gas constant.
Rearranging Equation (1) gives us:
$$
P_\text{real}\cdot V_\text{real}^3 - (n\mathrm{b}+nRT)\cdot V_\text{real}^2 + n^2\mathrm{a}\cdot V_\text{real}-n^3 \mathrm{ab} = 0 \tag{2}
$$
Notice that this is a cubic equation and, thus, we will obtain three roots.
Example
Here is an example of how $V_\text{real}$ varies with carbon dioxide gas $\ce{CO2}(g)$ for which $\mathrm{a} = \pu {3.658 bar L^2 mol^{-2}}$ and $\mathrm{b} = \pu {0.04286 L mol^{-1}}$. We are going to Assume:
$$
P_\text{real} = \pu{1 bar}\\
T = \pu{300 K}\\
n = \pu{1 mol}
$$
Substituting in Equation (2):
$$
V_\text{real}^3 - 24.985\cdot V_\text{real}^2 + 3.658 \cdot V_\text{real}- 0.157 = 0 \\
\implies V_\text{real} = \pu{24.838 L}
$$
The other two roots are complex and need not be considered. Under the same conditions:
$$
V_\text{ideal} = \dfrac{nRT}{P} = \pu{24.942 L}\\
\implies Z = \dfrac{V_\text{real}}{V_\text{ideal}} = \dfrac{24.838}{24.942} = 0.996
$$