Ugh, I got caught in this. I now always try to show them my US passport when leaving the country, but it doesn't always work. I'm a dual citizen, and was pulled into secondary screening at immigration coming back into the US, because I had used my NZ passport. I assume it must have been leaving the US? Because I can't see that NZ immigration was sharing information with them about which passport I entered NZ on. They told me I had to ALWAYS use my US passport to travel.
(Best part about this - my kids were both with me. My son was about 7. We're sitting in the very quiet room with all the detained people. No one was allowed to use electronics, so my kids are just looking around the room. My son asks me, quite loudly "Mom, what's sexual assault?" Thank you to the poster that told you who to call if the immigration officer sexually assaulted you!)