The character had been killed episodes before and appeared totally unexpectedly in the episode called Unearthed. As the Wikipedia notes:
Though his character Charlie Francis had been killed off earlier in the second season, former series regular Kirk Acevedo appeared in the episode, sparking confusion among some viewers.
Has this ever been properly explained?