Given the way that 5E deals with initiative - specifically, that you have to roll initiative to start combat before you can snipe someone - I'm not at all comfortable with the idea that the Alert character can potentially out-roll the distant assassin and kill them before they fire that warning shot that would draw their attention in the first place. Even less would I be comfortable with saying that they just happen to turn around, in that instant; the feat is Alert, not Lucky. In that circumstance, it would make way more sense to move the assassin to the top of the initiative order, since it's their action which actually initiates combat.
Being 'immune to surprise' does not equal 'your Perception rolls always succeed'!
In your example, the distant assassin rolled lower than the Alert PC. The assassin has a good hiding place (and a good Stealth roll) but while the Alert guy is not surprised (in game terms) he failed to spot the assassin (Perception roll was lower than the assassin's Stealth).
What does the Alert feat mean here? (Or a Weapon of Warning, or whatever makes you immune to surprise) Does it mean that the Alert guy actually detects the assassin despite failing the Perception check?
No, it just means that the Alert guy 'gets a bad
feeling about this!' and is ready for anything.
So the DM counts down initiative, and the first to act is the Alert guy; since he's not surprised, he can move and act normally.
Can he shoot the assassin?
No. He hasn't detected the assassin!
So what's the benefit of going first then?
Although the Alert guy cannot shoot a guy he hasn't detected, his 'spider sense' has warned him of danger.
It hasn't told him what the danger is, although he can look around for clues.
The Alert guy can move into cover, cast a self buff, take the Dodge action, anything he could normally do using the knowledge he has.
He has knowledge that it's about to hit the fan, but (unless he succeeded on his Perception) he has
no knowledge what the specific danger is, where the enemy is, that there is an assassin, anything like that.