The latter is exactly what causes the former to be wasted. If demand drops (or even merely does not rise as quickly as expected), then the price drops. If you were relying on high prices when you made your decision to invest more money to increase capacity, then what previously looked like a good idea may now be a bad one.
When your break-even price is $60 to $65/barrel and prices fall below that, your net return is negative. But the best part is you don't even get to stop producing. The costs for most oil sources must be paid largely up-front, and your marginal cost may be only $20 to $30/barrel. So when oil drops to $50/barrel, you can choose between continuing to produce at a loss of $10 to $15/barrel over the life of the well, or stop producing and suffer a much, much larger loss. That keeps supply high and prices low.
One oil source that does not have large up-front costs is fracking. Or, more exactly, fracking sites only last 18 months or so before production slows to a trickle, so you have a much smaller time horizon to recoup up-front costs. So the amount of fracking will very likely decline quickly. But viewed from an economy-wide standpoint, there was still plenty of malinvestment here: drilling equipment rental, trucking, rail, etc., require large capital outlays but carried high prices when oil prices and thus demand was high. As demand drops, they may not be worth the amount invested in them.