Did you eat a poppy seed bagel? That may have triggered the false result.
Very unlikely. It's kind of a high-school stoner urban myth, that you can take a drug test and if testing positive to heroin, claim you were eating poppy seeds. One would have to eat close to his body weight in seeds for this to actually happen.
That being said, some tests are better than others. It is *possible* but very unlikely.
OP, do you know what kind of test was used?
In answer to your question, different kinds of tests are more reliable than others.