Select Sum from two joined tables
By the addition join on payments, of which there are two, the productAmount got doubled:

select i.id, sum(distinct pr.amount * pr.quantity) as productAmount, 
sum(distinct pm.amount) as paymentAmount
from invoices as i
join products as pr on pr.invoice_id=i.id
join payments as pm on pm.invoice_id=i.id
group by i.id;


Also replaced LEFT JOIN with JOIN as you don't care about non-matching entries.