We have similar issue here
Last month there was a posted GJ journal between VAT Payable Control Account debit and VAT Recoverable Control Account credit for 15000. Both are Posting type VAT.
However i have noticed that at that time there was no VAT code specified. Now , user realised there was an error of 5000 exceess. Hence is passing another GJ entry opposite with value 5000. During posting it comes as "Posting results for journal batch number JBN-00xxx Voucher GJL-00xxxx VAT code must be entered if account number is a VAT account." And if you try to select a Vat code it comes up as "The Account that you are using has posting type Sales tax? if that is the case then you will have to provide Sales Tax code in this Journal."
Is there any way to resolve this?? By the way we are using D365.