Negative pregnancy test but gestational sac

Got a negative pregnancy but had an ultrasound and they found a gestational sac but couldn’t see yolk sac as it was abdominal, the sonographer puts me at around 5/6 weeks, how can this be right if the test is negative?