There is a simple trick to solve "not balancing" vouchers.
Imagine you are doing to the same transaction manually on a piece of paper.
Which transactions do you expect?
If you ask yourself this question, then you will be successful.
You mentioned its a payment, right? So, you expect the AP account to be debited, then based on the method of payment or offset account you expect account X
Are there any discounts applied, charges, foreign currency revaluation accounts ....
If all the accounts seem to be correct, then check the account structures if all these above mentioned accounts are included.
Good Luck Sherlock Holmes