I'm not a lawyer, but let's have some fun with this.
To start, I'm going to have to assume a jurisdiction. I'll go with California, because Hollywood films have depicted a lot of walking dead, zombies, and whatnot. And also because that's the jurisdiction I'm most familiar with. I think that such a case where the undead might be a witness would mostly arise in California state courts, since zombies rarely walk/jump/crawl quickly enough to cross state lines from the major population centers of California, which wokld invoke federal jurisdiction.
Now, we need to hone in on the type of case. A murder case where the victim is called as a witness would certainly be very juicy. But the same legal intrigue would arise from a less-interesting inheritance or family law case. We could also go into contracts and see whether or not the presence of an undead counts as an "act of God" but maybe that's a bit too niche and law-school theoretical.
To really showcase the problems this would pose to the court, we will focus on the undead being witness in a criminal trial, as the standard of proof to convict the defendant would be proof "beyond a reasonable doubt". As the most stringent category of proof, it necessarily follows that the court must err on the side of the defendant in matters of impartiality. This is because the court is technically an arm of the state, and the prosecution wields all the resources of the state against an individual who stands accused of some criminal act.
As such, for criminal trials, there are certain constitutional rights of the defendant that the court must uphold. The foremost is the right to due process, guaranteed by the Fifth and Fourteenth Amendments. One of the results from applying due process is that evidence introduced in a criminal trial must not be "unduly prejudicial". That is, no evidence can be admitted which so irresponsibly causes the jury to render a verdict based on anything but the law.
Often, this rule is invoked to set aside irrelevant evidence which has no bearing on the charges, except maybe to impugn the reputation of the defendant so that the jury thinks they're a terrible person. Other times, it can be used to exclude relevant but really-bad evidence. The US courts have been through cycles where novel science is used in a prosecution but which later turns out to be bunk and lacking any foundation in reality. It certainly is "evidence" but because it purports to be science when it's really not, it must be excluded. Psychics are certainly not going to be welcomed witnesses as a subject matter expert.
Finally, the other category for evidence being unduly prejudicial is when the jury -- through no fault of their own -- would weigh that evidence as being the primary factor, above all else, whether it's DNA or video evidence. This is more a matter of testimony evidence rather than physical evidence. Imagine a small, devoutly religious town where the local pastor is called to testify about whether the defendant could have committed hit-and-run.
Having a respected community authority figure testify about someone's potential to commit a crime might be something the jury members would be open to hearing, but the judge might have to weigh whether the fact that the lay witness is a pastor will cause the jury to put too much weight on that testimony, even though the pastor is no more able to weigh someone's character than some other member of the community. If there are other ways to obtain the same evidence -- such as bringing in the defendant's mother or employer -- the judge should not allow the pastor to testify, because it could jeopardize the soundness of the trial and lead to an appeal.
So now we come back to zombies. Would a jury be able to set aside their shock, horror, and awe about a zombie in court that they could focus on being the finder of fact? If a zombie says they're an eye-witness to a mugging, would their lack of actual eyeballs confuse the jury? Even more confusing would be a zombie that is testifying as an expert witness. Does their subject matter need to be recent? What if the case needs an expert on 17th Century Parisian fashion and the undead is from that era and worked in haute couture? Are there no fashion historians who could provide similar expert opinions?
But supposing we did overcome all that, there might be one form of testimony which -- even though very prejudicial -- might be allowable for a lay-witness (ie not expert) zombie witness to testify about, and I already mentioned it earlier.
In most jurisdictions and in California, a dying person's last act which might point to their killer will not necessarily be excluded for being irrelevant or being circumstantial. It is a rebuttable presumption that someone dying has no incentive to lie, and will likely have been the final witness to their own murder.
To that end, it's entirely plausible that a zombie who died by murder could come to court to testify against their killer. Of course, how long does it take for the dead to become undead? If this takes longer than the statue of limitations allows (note: California has no limits for charging murder), the defendant would walk. Likewise, if the zombie's testimony is the only shred of evidence for the murder, that's not likely to convince the jury. Not unless, of course, the details of the testimony match the circumstances of the crime so well that it wasn't a fluke.
TL;DR: rules of evidence would still apply to the undead, and judges must take care to balance the probative value of evidence with any prejudicial quality it may carry.
(to be abundantly clear, this was a schittpost lol)
One final addendum is that we have as of right now no guarantee that the necromancer or non-corporeal entity that has reanimated said deceased person is not somehow capable of either altering the witness or unduly influencing the responses of said witness.
Therefore, the person or being responsible for said reanimation has to first pass muster as to their partiality on the case.
If they can't do that then you can't verify that the witness is giving truthful testimony beyond a reasonable shadow of a doubt
You are correct: even when you have a live body on the stand about to give testimony, it is essential to lay the foundation as to who they are and their legitimacy. Obviously, if they aren't who they say they are, that's a huge problem. So the party who called the witness will have done their homework in advance, and the opposing lawyers will have been notified in advance of this witness's appearance and conduct their own homework.
For when a person is testifying but they aren't in the room, I understand that there are several requirements that a telepresence system must comply with, both technical and usability. Certainly, someone's visage or image would be preferable to an audio-only phone call. Presumably, the jury needs to trust this witness to believe them or else it's rather pointless. Nowadays, with deep fakes and AI, it could possibly become an issue in future if video appearances in court are actually faked, or if the suggestion becomes plausible due to advancements in the technology.
So if we think of the zombie not as a live body but someone whose presence is being facilitated by the necromancer's abilities, then the necromancer must be quizzed as to the veracity of their abilities, and the court would have to question what limits must be imposed on the testimony to make it admissible.
If it's anything like the bunk science that courts have previously adopted -- bite mark analysis comes to mind -- then it only takes one court to permit necromancy and other courts will point to that one case as precedence. This would only be a problem if the necromancy is flawed in some serious way.
you've thought about this a lot more than I have. I was mostly thinking about being a witness to their own murder, and how the opposing lawyer would down play the testimony due to the process of necromancy or something. Or how the courts would dismiss or not allow the testimony due to the uncertainty of the necromancy.
I didn't think about pulling the dead to be subject matter experts, or a bystander witness.
It's fun to imagine this long dead guy always being resurrected because his the topmost expert in some relevant field, like ballistics.