We are all human. Even those of us with more challenging circumstances. Allow yourself to make mistakes, learn from them and move on.
More often than we'd like, we find ourselves losing our patience with our children. We snap, or yell, or punish when we know what they need is compassion and understanding. It's just not always that easy. And because we are just so exhausted it is easy to get down on ourselves. We tell ourselves that we are bad parents, or they would be better off if someone else was their mom or dad.
Be kind to yourself. Instead of all the negative self talk we are all prone to, treat yourself like you would treat your best friend. If your friend was explaining a situation to you like the one you just had, you would tell them it's ok.... they are not a bad parent... everyone loses it from time to time and to forgive themselves. So listen to your own advice. Be the friend that you need for yourself. And if you need to, apologize to your child. Letting your child know you are human will go a long way in your relationship with them.