Proof of Co-Problem being in NP if Problem is in NP using negated output


Given any problem $ P$ that we know of being in $ NP-\text{complete}$ , where is the flaw in the following proof?

Given a problem $ Co-P$ which is the co-problem of $ P \in NP-\text{complete}$ , $ Co-P$ is at least in $ NP$ because the following algorithm can always be given:

Co-P(J):     bool res = P(J)     return !res 

Where $ Co-P(J)$ is the algorithm solving $ Co-P$ and $ P(J)$ is the nondeterministic polynomial algorithm solving P.

Why is this not correct?