To early?

I took a pregnancy test 5 days before my period because I got this app and seen that I had unprotected sex on one of the red days. But the test showed negative. So I thought I was okay.. But now I'm 3 days late on my period. & getting freaked out again. Could the test been wrong because I took it so early?