Error 10413 means the totals don't match, but their documentation specifically states AMT is supposed to include the tax while TAXAMT is specifically just the total tax amount. So I have no idea. I've followed their documentation as instructed. If the AMT needs to subtract TAXAMT then they need to fix their documentation to clarify that.
It seams like the basket would need to be entirely itemized and sent to PayPal as itemized to utilize TAXAMT, but their documentation is not clear regarding that. It may require ITEMAMT, which is just AMT. You can try the below.
Code:
'AMT' => $amount,
'ITEMAMT' => $amount,
'TAXAMT' => sprintf( '%.2f', $paymentBasket->tax ),
It gets significantly more complicated if the entire payment needs to be itemized and sent to PayPal as such and such feature implementation won't be anytime soon as I'm basically having to redo the entire payment process and testing of it.