I'm not an expert on ComBat, but neither code seems to make any sense. You only have one batch in both cases, so there is no batch effect to correct for. Using ComBat does not make any sense.
Now, I'm less sure about the correct code if you had put more than one batch. I think only the first code is correct. You would consider any differences between the subgroups to be due to biological differences, so there would be no need to adjust for them? Anyway, this is how I use ComBat to remove batch effect (obviously I have more than just one batch, as in this example). Someone smarter and more knowledgeable than me will probably come up with a better answer.
Can you share your data matrix and genotype information ? I would like to run my code on your data.
Could you please share your code ?