Gordon is correct.
Sales Order -> Delivery -> Return
You never created an Invoice. The Return removes the items from the Delivery by placing them in another field. If you create the Invoice based off of the Delivery the invoice will show 4.
If an Invoice had been created.
Sales Order -> Delivery -> Invoice
You wouldn't be able to create a Return based on the Delivery because it would be closed. You would create a Credit Memo based on the invoice. The credit memo would reverse the revenue entry and put the items back in stock.