Do you know how trans people on HRT respond to Ambien, as your first link brings up? I sure don't. Depends on why the drug works differently.
If you're scared that you'll die because your doctor thinks you're cis, tell them you're trans.
That doesn't mean you have to tell your doctor "I'm really a man, despite being a trans woman, and it's definitely important for you to store an M in your records because you might suddenly forget that I'm trans and also I'm sure my reaction to medicine is the same as a cis man's."
Just be an adult and talk with your doctor honestly.