In perfect competition, why is there economic loss if marginal cost > marginal revenue?
There is no loss at Q' and you are indeed right that the yellow area represents the firm profits. However, if you were to compare the yellow area to the blue area you would find that the latter is greater. So profit for the firm is not optimal at Q' but is optimal at Q*. This is what the quote refers to, it says the firm will be generating losses on its marginal production (so on the quantity Q' - Q*). It does not say that the firm will generate losses on production in general. This will only happen beyond MR=ATC or TC=TR