lolsworthy bias from Mainstream Economics Textbook

I’m studying for this economics test I have soon. There’s a section on market failure. Before it, it talks about consumer surplus and producer surplus, how both parties can better off through an exchange. The last sentence in that section says “all participants leave the market at least as happy as they were when they came to it”. But in the market failure section:

“Reread the last sentence of the preceding paragraph. It seems to suggest that the market works perfectly and that there is never cause for government to intervene. Intuitively you know that is not true

OR ELSE YOUR DUMB! lawl

Now I understand why libertarians tend to think statism comes from conditioning.