Ellos no le habían invitado a Ana a cenar pero ella vino igual
is grammatically incorrect, because "a Ana" is a direct object, so it can be replaced/referred to by the pronoun "la", but not by the pronoun "le". This kind of mistake is called "leísmo". See here for the rules on "lo", "la", and "le".
Indirect objects can be redundantly referred to by both a noun and the pronoun "le/les", so the sentence
- Ellos no le preguntaron a Ana si quería venir
is correct. However, in most of the Spanish-speaking world, direct objects cannot be redundantly referred to by "lo/la/los/las" if the other instance is a noun that appears after the verb (see paragraph 5.2b here). Therefore, the following two sentences are correct:
Ellos habian invitado a Ana a cenar, pero vino igual
Ellos no la habian invitado a cenar, pero vino igual
but the following sentence is incorrect in most regions:
- Ellos la habian invitado a Ana a cenar, pero vino igual.
As also mentioned in paragraph 5.2 of the linked DPD article, this last sentence is correct in a few Spanish-speaking regions, particularly the countries around Río de la Plata (Argentina, Uruguay).