The gender of the person might not change the gender of the noun that refers to it (I'd suppose the noun's gender is actually fixed.) But, possessive pronouns might not care about the gender of the noun in cases where a person is the referent and the person's gender is known. It seems (intuitively, and as a grammarian you should be innately used to discarding your intuition since it's often going to be irrelevant) if the gender of the person is known, it should take the correct gender of personal pronouns. But it might be more important that the word for prosecutor in the sentence actually has an (innate) feminine gender?
That's why you should be confused, same as I am.
If I had to guess, prosecutor is a noun that is either masculine or feminine depending on the gender of the referent, but if I had to second-guess, I'd say that's in fact probably wrong and nouns always have concrete genders of their own. Hopefully someone knows and comes along to tell us both, I'm curious now.
Edit: German Wikipedia agrees:
Ein Staatsanwalt (Kürzel StA, weibliche Form: Staatsanwältin), in manchen Staaten auch Procurator, Procureur bzw. Prosecutor genannt, ist bei Gericht oberster Vertreter der Anklage.
Die Staatsanwaltschaft (StA) in Deutschland ist eine weisungsgebundene Behörde, die für die Strafverfolgung und -vollstreckung zuständig ist und als solche ein Teil der Rechtspflege ist.
Whether it translates "her" or "its" depends entirely on what the rest of the sentence means in English, the fact that nouns in German are gendered and this one is innately feminine does not even enter into the equation.
Thank you for figuring that out.
Thanks for the correction.