Origin of the voltage gap and recombination losses in all-perovskite tandem solar cells