Is it possible to mess up the function of the vagus nerve?

Yes. If the vagus nerve is injured during surgery, the function of it will be affected. This can either be temporary or permanent, based on whether the nerve was just stretched or cut. Surgery of the foregut, which includes the esophagus and stomach, are the most common surgeries that can injure the vagus nerve.