In the sense of your comment, that "infections are a sign you did something wrong", having surgery is "doing something wrong". Your body has no plan for you to undergo surgery; it relies on the assumption that your skin separates your inside from your outside and any contact between inside and outside not mediated by your skin or your stomach is a catastrophic failure.