when RF triggers, the game checks not only for friendly fire, but also checks the percentage of the shots fired that actually hit the enemy (using a sample of ~100 mock shots), if it is too low RF won't trigger, and yes the same check is applied when the AI uses RF, so if the AI uses RF but your soldiers don't
Well sorry, but that seems a bad logic to me. If there are no friendly units in danger of being hit, reaction fire should just always trigger, independently from such a calculation. The soldier is almost guaranteed to die (especially otherwise, meaning he doesn't reaction shoot).
I'm pretty sure I also have seen it happen that the alien trick fails though, the alien fires 3 shots or even full auto, but all of them hit the obstacle(s). It's just that if even a single one slips through, that means instadeath due to the difficulty scaled damage.
And it of course happens that my soldiers actually reaction shoot, but generally only if there are no obstacles in the way, which means that being partly covered to make being hit less likely is not allowed.
EDIT
your soldiers aren't accurate enough to put enough shots through that corner.
In the depicted situation, assuming perfect accuracy of my soldier, *all* of the reaction shots would hit the obstacle. As I said, the alien moves onto a position slightly behind a corner or obstacle before shooting. The shot line from my soldier to the alien is (would be) red, and in the other direction it's got to be as well, logically. So, given the reaction fire check with the 100 shot tests, it of course doesn't trigger then.
EDIT2
To not be misunderstood here...it is perfectly fine with me that the AI is exploiting things, and also that the soldier dies. The problem is that reaction fire is so buggy...
EDIT3
This check with 100 sample shots might also be why reaction fire seems to never work on long range then (but not so long that the weapon's range is exceeded).