After research we've figured what may be a reason for this particular bug.
The issue is caused by rounding at X-Cart side (e.g. when certain tax %% values are configured) and PayPal line items specifics. I.e. X-Cart passes a little bit wrong values to X-Payments, that are then passed to PayPal as line items they require and as result totals do not match at PayPal side and the payment fails.
A solution is not to pass line items to PayPal if totals do not match and we have a patch for X-Payments connector in X-Cart 4.6.5 (xpc_amount_mismatch_wa.diff
) for that.