No matter how good you are or talented you are, you will still produce some shitty work. This fact applies in everything. You cannot escape this, you are not perfect and you have to accept it.
Even if you are the greatest player, you will still have some nights like you don't know how to play. You will commit a lot of mistakes, you will let the team down and you will play like shit. There is nothing wrong with you, it only shows that you are just a human.
Even if you are the greatest writer, there will be some nights that you cannot literally write anything, your mind goes blank and words cannot show itself to give you a finish result. It seems like you don't know any kind of word in the dictionary and frustration becomes bigger and bigger. You can't find the remedy, you don't know what is wrong with you.
Even if you are the smartest person in your country, you will still make wrong decisions, You will still produce works that are meaningless and cannot contribute to the society. But you have to be ok with it because just like I said you are just a human.
Even if you give your best, there will still be nights where you can't produce something great. Your body is so heavy, your mind is so rusty. You're like a kid who can't do a man's work.
But that is ok, just like I said you're just a human, it only shows that you are not invincible.
Stop blaming yourself, don't be hard on yourself. Let go of what happened and focus on the next thing. You can rest for now, forget everything happened. Tomorrow is a new day, tomorrow will be better.