Suppose I wish to find out whether $\{M: \text{M is a Turing machine that does XXX}\}$ is recursive, where $XXX$ can be anything about the Turing machine. I have a bad proof that proves that all such sets are not recursive, but I don't know why this proof is wrong.
I propose the following Turing machine, for some Turing machine $N$ and input $y$:
$M': \text{M' does XXX if N halts on y, otherwise M' does not do XXX}$.
Suppose that $\{M: \text{M is a Turing machine that does XXX}\}$ is recursive; then whether $M'$ does $XXX$ is known. Hence whether $N$ halts on $y$ is known (i.e. the Halting problem is decidable), which leads to a contradiction. Hence we conclude that $\{M: \text{M is a Turing machine that does XXX}\}$ is not recursive.
But sets like $\{M: \text{M is a Turing machine that has at least two states}\}$ are clearly recursive.
May I ask what is wrong with this proof?