The decision to scrap the venture underscores the strain on legacy automakers due to high costs and fluctuating demand.