 Our Constitution was written contemplating the laws that came before it, including that the executive could not be prosecuted by the other branches for their acts in office. It's one of the things that led to the Roman Civil War and the rise of Caesar is they decided in Rome that they were going to prosecute Caesar for the things he did in time in office.