Communication is the answer.
If you think you're going to quietly go back to your laptop and solve all of these problems by being more careful, you'll probably end up disappointed.
You should take this as a learning opportunity to improve your communication skills. Communicate early and often. Ask for feedback. Ask for clarification. Ask for code review. Ask for a performance review.
Also: There is some good advice in this comment section, but there's also some absolutely terrible advice. Please ignore all of the low-effort comments insisting that you should quit or the comments suggesting that your boss's boss is malicious "gaslighting" you. This may be your first stumbling block in the workplace, but it won't be your last. If you make a habit of shutting down, quitting, or becoming resentful in these situations then you're never going to learn how to build actual healthy relationships in the workplace. Do as much as you can to learn from this, but make sure you do move on as quickly as possible. Don't let it eat you up.
In a situation like this you need to be able to think on your feet and choose your words carefully, which can be very difficult if you have reverted to a defensive or fearful "fight or flight" mind state.
I personally have benefited a lot from biofeedback and meditation over the years, if only because it has given me the tools to recognize when I am in a fearful state and calm myself down.
The "fear is the mind-killer" mantra from Dune is not really fiction!
As for the project, you should consider how much mentorship you received. If there was none, then obviously a high degree of mistakes is natural, especially for someone new to "professional software development" (if such a thing exists). If there was a lot of it and you blatantly ignored it, you should take responsibility for it.
Most importantly, keep a healthy work-life balance. It's easy to forget it, especially when first entering the workforce and thinking that you need to "prove yourself". Most of us are average; if you are too, accept it and keep living as best as you can. The 10x coders can keep on 10x-ing, but the world depends on the average person.
Early days. One of the key things you get with experience is the cold blood to wait some things out and to not let minor or major incidents get under your skin. If/when this becomes a pattern assess it against the rest of your experience and decide on your best path forward.