There is a very common error we encounter when posting PO invoice;
To resolve this issue, please check if vendor posting profile is correctly setup in Accounts payable parameters form.
To check the setup, navigate to;
Accounts payable -> Setup -> Accounts payable parameters -> Ledger and sales tax -> Posting -> Posting profile
When attaching vendor posting profile, make sure that related vendor group is linked to the selected posting profile. To confirm, navigate to;
Accounts payable -> Setup -> Vendor posting profiles