To the author, I've experienced this from both sides, and I want to say that it can be very hurtful to receive criticism that goes beyond the work and feels directed personally. It can feel isolating and ostracizing. That said, I want to encourage you to try to distance your sense of self from your prior work. I know that can be difficult.
It can be hurtful to hear that your work is "bad", you might even disagree that it's bad. As long as those comments are focused on the quality of the work and not the quality of the person who wrote it, that's a discussion that can be productive even if it's exceedingly inconsiderate. That work isn't you. If you're ready to acknowledge that it was compromised by certain constraints, you can find ways to value the drive to improve it as new minds with a different set of constraints come in.
We all have an opportunity to learn. For those of us maintaining debt-ridden code, we can welcome improvements, however gradual or wholesale, as they're introduced. For those of us walking into what seem like trap doors and quagmires, we can welcome opportunities to be more aware of the stress and effort put in by the people who came before us.
Software can always be more correct and more precise and more forgiving and any number of values we might search for in our engineering pursuits. Software engineers can always be more kind and more compassionate and more caring.