If Red Herring isn’t a legal target for a spell or ability that targets the returned spell or permanent, that spell continues to target what it originally did. That spell or permanent will be an illegal target for the spell or ability, and that spell or ability won’t affect it.