The advice I would give someone in medical school is to choose the academic opportunity that will be most productive for you. Ideally, yes, you would be very productive in the field you want to go into; however, many schools/programs do not necessarily have people in that field doing a lot of research. Trying to force a project in your chosen field with someone who doesn't do - or isn't committed to - research, will be a very frustrating process.
It's no secret that programs want people who are going to be productive doing research because they want grunts to come "assist" them with their research. So, what you are ultimately trying to demonstrate is that you know how to be productive with research; that you can write a manuscript, work through an IRB, either do stats on your own or work with a statistician independently, etc. They don't want someone that they are going to have to hand hold. In my mind it matters much less what this specific research was in, and more that you were productive doing it.
Disclaimer: This holds true for most fields, but there may be some I am unaware of that do not care much for pubs outside of their chosen specialty.