Valuing closing inventory at 450 instead of 500 means that the cost of goods sold will be higher and therefore the profit will be lower.
However, so as to show the correct gross profit for the goods that were actually sold, then strictly we should show 500 (450 value of inventory + 50 loss) in the trading account when arriving at the gross profit, and then should subtract 50 as an expense to arrive at the correct final profit.