Psychic terrain seems to work incorrectly and correctly in the same battle:
https://replay.pokemonshowdown.com/gen8vgc2020-1053668606
Turn 4, ESpeed goes through Psychic Terrain. Turn 6, it doesn't. Are the mechanics of Psychic Terrain more nuanced than "no priority works"?