This paper shows that when agents on both sides of the market are heterogeneous, varying in their costs of investment, ex ante investments by firms and workers (or buyers and sellers more generally) may be too high when followed by stochastic matching and bargaining over quasi-rents. The overinvestment is caused by the fact that low-cost agents, by investing more, can increase the value of their outside option and thus shift rent away from high-cost investors. Numerical simulations show that overinvestment can occur given parameter values calibrated to OECD labour markets.