Why did Psychic work on Umbreon and Zoroark in the Pokémon anime?

The Pokémon anime does not strictly follow game mechanics, but in this case there is an in-game explanation: Miracle Eye.

The general answer

The anime is a loose adaptation of the games. Moves and type matchups often work differently there, so you should not expect game rules to apply.

A possible in-game explanation

Miracle Eye is a Psychic-type move. It makes the user ignore the target's evasion boosts, and it removes the Dark type's immunity to Psychic moves. In the episode Mission: Total Recall!, Faba's Alakazam used Miracle Eye and then Psychic to beat Gladion's Umbreon.

This explains Faba's Alakazam against Umbreon. It cannot cover every scene across the series.

Related pages