In perfect competition, why is there economic loss if marginal cost > marginal revenue?

Consider the following graph

enter image description here

I read from CFA L1 notes that “At any output above the quantity where MR=MC, the firm will be generating losses on its marginal production and will maximize profits by reducing output to where MR=MC.” But now consider this:

enter image description here

Q′ is an output level above the one at which MC=MR. Shouldn’t the yellow region represent a positive economic profit in this case? I can understand that at any output level above the one at which ATC=MR, the firm would start making losses. But isn’t the quote above incorrect, or am I missing something? Sure, you might be making a suboptimal profit at output = Q’, but you’re certainly not making an outright loss.

profit = revenue − cost

marginal profit = marginal revenue – marginal cost

If marginal cost > marginal revenue, then,

marginal cost > marginal revenue

0 > marginal revenue – marginal cost

0 > marginal profit

Your marginal profit is negative; i.e., profits are decreasing.