The problem with your proof is the fact that a TM for $NP$ would be non-deterministic.
The non-determinism allows the machine to split up into branches of computation, and your machine will accept iff there is a branch in which the computation accepted.
In order to know whether on an input the machine did not accept, you would have to know whether for every branch it did not accept.
Switching the result from a non-deterministic TM is pretty much like swapping between $\exists$ and $\forall$ and checking $\forall$ is a totally different problem than checking $\exists$.
I hope this made sense to you! If not, try to think of $NP$ as polynomial verifiable languages, i.e languages with a machine $M(x,w)$ where $w$ is a "witness" describing the $\exists$, and then calling a routine for an NP problem means calling $M$ with the correct "witness" - but to know that the input $x$ is not in the language means to know that every "witness" is not a correct one