Prescriptions while pregnant

Tiffany • Mommy To Baby Boy Daxton 11/25/17 and Baby girl Elianna 11/25/18. Yup my babies share the same birthday 🥰 Baby #3 Raelynn 💖 due 02/23/20
I've been having really bad pain in my teeth and my dentist sent over a prescription of Acetaminophen-Codeine #3. I asked if it was okay to take while pregnant and she said yes, but in the drug information packet they give you at the pharmacy with the prescription it says This drug may cause harm to the unborn baby if you take it while pregnant. If you are pregnant or you get pregnant while taking this drug, call your doctor right away. I don't like the sound of that at all and it kind of made a sinking feeling on my stomach after I read that. If the dentist said it's fine to take while pregnant, why is the drug information stating other wise?