Then what is it? And what is "deficiency in legality of appointment or election to office?"
I don't really want to continue an extended debate with you on this topic. You can do the legal research to find the Supreme Court law on the issues which is actually fairly clear on the decided points.
It has long been established law that where there are ministerial errors in determining the election result or in certifying or installing the person deemed to have been election which result in a person being installed in office who is not the person who won the election, the installed candidate serves with full power of office until he is removed or replaced by due process of law.
It is further established law that these rules do not apply when the deficiency in the person installed is that they are not eligible to hold the office--a person who is not eligible does not hold the power of the office; that simple.