Biodiversity-ecosystem functioning (BEF) literature is dominated by investigations conducted in temperate grassland ecosystems under homogenous environmental conditions. Consequently, studies concerned with the functional importance of higher trophic levels, or with the role of environmental conditions in shaping BEF relationships, are comparatively uncommon. To address this, we assessed dung beetle diversity-functioning relationships in situ, in a field experiment in the Brazilian Amazon. Dung beetles perform a number of ecological functions in habitats across the globe; in tropical forests they play a key role in the secondary dispersal of seeds. We therefore experimentally tested how the functional diversity of dung beetle communities affects seed dispersal and how BEF relationships varied with environmental context, by replicating the experiments under contrasting soil conditions. Relationships between dung beetle diversity and function were examined using diversity indices calculated using continuous morphological traits of the individuals involved in experiments, and functioning was measured as the dispersion of artificial seeds throughout the soil profile and the probability of burial. Ninety experimental plots were established across three distinct primary forest sites. We collected, identified, and measured almost 2000 beetles, and sieved around 11 Mg of soil to quantify the dispersion of 1800 seed mimics. There was a significant effect of dung beetle functional diversity on both seed dispersion and seed burial, although this depended on environmental context, with the strength or direction of responses differing across the contrasting soils. Regardless of soil type, functional richness, but not species richness, predicted seed dispersion. We therefore advocate the use of functional diversity indices over taxonomic approaches in dung beetle-focused BEF investigations. Furthermore, we highlight the difficulties in generalizing BEF relationships, even considering a single function within the same ecosystem.