If the target player is an illegal target by the time Thought Distortion tries to resolve, the spell won’t resolve and will be put into its owner’s graveyard with no effect. This is true even though it can’t be countered.