The construction of Z-scheme heterojunction stands out as one of the most effective modification methods for enhancing the performance of photocatalysts. Therefore, BiOClxM1-x (M=I, Br) solid solution-coupled CdS (BiOClxM1-x/CdS) Z-scheme photocatalysts were successfully synthesized by a hydrothermal-precipitation method. BiOCl0.8I0.2/CdS exhibited notable photocatalytic performance with a hydrogen yield of 261 μmol/g, which was 2.23, 1.56 and 1.44 times higher than that of CdS, BiOCl/CdS and BiOCl0.5Br0.5/CdS, respectively. This improvement can be attributed to two key factors: (1) the formation of BiOClxM1-x (M=I, Br) solid solution enhances visible light absorption; (2) The formation of BiOCl0.8I0.2/CdS (M=I, Br) Z-scheme heterojunctions inhibit the recombination of photogenerated carriers to prolong the lifetime of photogenerated carriers, thus increasing the utilization of the photogenerated carriers. Moreover, BiOCl0.8I0.2/CdS also showed good photocatalytic activity in ROW-DFHP (residual organic wastewater from dark fermentation for hydrogen production), with a hydrogen production rate of 42.83 μmol/g and a mineralization rate of organic pollutants of 31.73%. Cycling experiments, XRD and SEM of the samples before and after the photocatalytic reaction showed that BiOCl0.8I0.2/CdS has good stability. Furthermore, the mechanism of BiOCl0.8I0.2/CdS for the photocatalytic degradation of organic pollutants and simultaneous hydrogen production was proposed, offering a novel strategy for organic wastewater purification and hydrogen energy recovery.