You're getting this issue because you're passing in a HTLM string, not the actual DOM nodes, so you're changing classes on a completely unrelated piece of HTML that has nothing to do with the actual nodes in the document.
To fix it, change
fixit($("#testit").html());
to
fixit($("#testit"));
and modify the function to work with the DOM, not a string you pass in
function fixit(data) {
$.each(data.find("a"), function (i, item) {
var thisrel = $(item).attr("rel");
if ( $('#' + thisrel).length > 0 ) {
$(item).children().removeClass().addClass('tick');
}
});
}