The diverse baryon fractions of gas-rich dwarf galaxies