https://www.pnas.org/doi/10.1073/pnas.2506130122
You could have answered your own question by reading the abstract, which makes it clear that the OP's conjecture was correct: the lotteries were random or somewhat random, but the groups which consented to the study were notably different, with the treatment group being richer, more educated and whiter. They did of course attempt to control for this, whether the controls were adequate or omitted other underlying differences is another question.