@evan Jean Charest, to name a local politician, resigned from the federal cabinet after he had contacted a judge about a constituent's case. Eventually he returned to cabinet, and his political career continued with a reasonable record of achievement.
Many such cases; WSC also comes to mind.
It's good for politicians to resign when they are responsible for a grave error. We want to encourage such choices. But it needn't be the end.