Yes, you're right. There were a lot of failures in the system that led to what we're about to deal with. However, there's nothing in the Constitution that prohibits an impeached president from being elected again. So it ultimately came down to the DoJ that failed to prosecute and convict Trump for his many crimes. Of course, there's nothing in the Constitution that prohibits a convicted felon from being elected president either, so...
I guess the only thing that could have possibly guaranteed The Melon Felon would never again occupy the Oval Office would have been if Congress had the balls to invoke Section 3 of the 14th Amendment.