The Rambam writes in his Sefer HaMitzvos Lavim #290:
"Even if A pursues B with intent to kill, and B takes refuge in a house, and the pursuer follows him, and we enter after them and find B in his last gasp and his enemy, A, standing over him with a knife in his hand, and both of them are covered with blood, the Sanhedrin may not find the pursuer A liable for capital punishment, since there are no direct witnesses who actually saw the murder …" The reason given by Maimonides is that if the court was permitted to convict a suspect of a criminal offense on the basis of other than the unequivocal testimony of witnesses to the actual act, the court might soon find itself convicting of criminal offences on the basis of a "speculative evaluation of the evidence. source
Why don't we apply the rule of Anan Sahadi (we're witnesses)?
We execute people based on this principle. For example, the Halacha is that we execute a son who wounds his father. How do we know it's his father? We don't claim (to save the child) that he was adopted or that his mother committed adultery with another man due to "us being witnesses" that this is their child.