How does cover / line of sight work in XCOM 2?
Since no one (other than Firaxis) can know for sure, here's my interpretation of your picture:
The soldier you're trying to target isn't standing in the open door, but next to it. He's standing in the same line as your soldier, and the full-cover-box you can see behind the doorway.
I think it's that specific box that is blocking your LOS. Even if we consider that your soldier sidesteps (so let's assume she's standing one tile to her left); it's possible that the slight elevation of the train cart combined with the angle of the box (relative to how your unit would see the enemy soldier) leads the game to decide it's not in LOS.
That being said, this is just a guess. I remember being in similar situation and seeing my target. The only thing different here is that box, which is why I'm thinking that's the reason.
Edit
For those who argue that the enemy (model) is in sight of the soldier, therefore it should be targetable, keep in mind that the game calculates based on the tile a unit is on, not the actual visibility of their character model.
I find that units in cover really cling to the cover, or try to pop out their heads, and it throws off your vision on where the tile is located. If you look at OP's picture, you'll see how much difference there is between the enemy's body and the actual center of the tile they're standing on.
Not entirely an answer, but a bit too big for a comment. If you're looking to achieve a certain shot from a position, you can check the shot before you even make the move by using the line of sight indicator.
Line of Sight Indicator: I'd heard of this, but hadn't had anybody explain where it was. It's a tiny cross-hair next to an enemy's health bar. If that's there, then your unit will be able to fire on that enemy from your cursor's current position. /u/Infernal_Dalek
Source: https://www.reddit.com/r/Xcom/comments/44b7pf/xcom_2_tips_megathread/