Hello Lourenço,
The fact that the company uses WAC also applies to the movements in finished goods, not only to the movements in raw materials.
Therefore, the COGM/unit of 216€ only refers to the 5 000 units from production. In addition, you need to consider that there are opening stocks of finished goods of 1 000 units at 200€/unit. So, you also need to calculate the WAC for finished goods, which will be around 213.33. Then, you can multiply that value for the 4 000 units sold.
Hope this helps