This is a big worry for me too. The rest of my materials are all fine -- great grades and GREs, multiple publications, etc -- but my writing sample doesn't explicitly match the specific research interests I've outlined in my SOP. It's meant more as a general indication of my capabilities, given that the research described in the SOP is yet to be carried out. I'm hoping adcoms will see past that lack of 'connection' and will recognize the broader thematic / theoretical / historical interests that make my application cohesive. Or at least, I was hoping that. Right now I'm feeling like this poster -- I've made a mistake here, and won't get in anywhere.