Intraspecific competition is believed to drive niche expansion, because otherwise suboptimal resources can provide a refuge from competition for preferred resources. Competitive niche expansion is well supported by empirical observations, experiments, and theory, and is often invoked to explain phenotypic diversification within populations, some forms of speciation, and adaptive radiation. However, some foraging models predict the opposite outcome, and it therefore remains unclear whether competition will promote or inhibit niche expansion. We conducted experiments to test whether competition changes the fitness landscape to favor niche expansion, and if competition indeed drives niche expansion as expected. Using Tribolium castaneum flour beetles fed either wheat (their ancestral resource), corn (a novel resource) or mixtures of both resources, we show that fitness is maximized on a mixed diet. Next, we show that at higher population density, the optimal diet shifts toward greater use of corn, favoring niche expansion. In stark contrast, when beetles were given a choice of resources, we found that competition caused niche contraction onto the ancestral resource. This presents a puzzling mismatch between how competition alters the fitness landscape, versus competition's effects on resource use. We discuss several explanations for this mismatch, highlighting potential reasons why optimality models might be misleading.