Everybody writes buggy code and those who say they don't are kidding themselves. The most important thing is how you react to bugs being found. The right answer is to acknowledge the problem and fix it. Write a unit test so it never occurs again in this code. If you get hit by a common type of bug that's preventable in code, often, then your unit testing is not up to scratch.
If you write software for production and don't do unit testing then you are in the wrong job.
If you write software for production and don't do unit testing then you are in the wrong job.