Jaw surgery during pregnancy?!?!

I had jaw surgery 2 weeks ago as part of my orthodontic treatment and I was on birth control. I was under anesthesia during the surgery but before the surgery they made me take a urine sample I’m assuming to check for pregnancy but it came back negative. Anyway, I started feeling “off” a week later and decided to take a pregnancy test because I was really nauseous but it was the last thing on my mind because I was on birth control. The test came back positive twice so I go in to see a doctor to be sure and it came back positive and they did a quick ultrasound and measured me as 12 weeks pregnant which means I was 10 and a half or 11 weeks when I had the surgery. I don’t understand how the test came back negative being that far along. But my main concern is having the surgery while being pregnant especially during the major developing stages. I’ve done research and read about teratogens and the increased risks of abnormalities, still born and so on. I am freaking out.