If the data generating process was **fixed** over time, you would choose the longest available data sample for cointegration testing -- because a larger sample yields higher power for the test. If the data generating process is **changing** over time, then you would identify the time period of interest and use only the corresponding subsample to test for cointegration -- because the test results would differ across periods/subsamples. If the test results change depending on the period/subsample (**your case**), it is likely that the data generating process is changing over time (across subsamples) -- although if the process is random, which it normally is, you cannot be 100% sure. Then you have to choose the subsample of interest and test and make inference for that particular subsample, being aware that inference might not hold for other periods/subsamples.