5th dnd – Does a spell cast in the place of an Opportunity Attack always observe the moment of an Opportunity Attack?

The only mention that the war gift makes the operation "War Caster" is that it happens (emphasis mine):

When the movement of a hostile creature causes an opportunity attack on your part, you can use your reaction to cast a spell on the creature, instead of launching a second-hand attack.

There is no change in the timing of the reaction, except that you can cast a spell instead of making an opportunity attack. So, spells cast with a reaction using the War Shooter exploit always obey the rule with regard to opportunity attack timing:

The attack occurs just before the creature leaves your reach.

Your text quoted in Xanathar's Guide to Everything says (it's me who points out):

If you have any doubts about when a reaction occurs with respect to its trigger, here is the rule: the reaction occurs once the trigger is complete, unless the description of the reaction explicitly says otherwise.

Rules for Opportunity Attacks make "explicitly say the opposite" as quoted above. Therefore, this general case rule does not apply.