Hm, that's an interesting way to look at it, though I don't like framing it as ego fragility as that seems unfairly negative.
I've reflected on this point quite a bit because I really struggled with it when I was teaching myself how to code. It's extremely demoralizing in the beginning, because of a couple of root causes (IMO).
1. We place a lot of cultural value around "genius", and we often ascribe that quality to programmers, mathematicians, etc. While some of them undoubtedly are, it's not clear what that genius actually is, and a great deal of people mistakenly believe that they don't have the "right brain" for it, or are not "smart enough", because they don't feel like geniuses. When you make several mistakes when learning a new activity, every mistake reinforces that perception.
2. There are two relationships you can have with technology - that of a consumer , and that of the provider. As a consumer of technology, your perspective is that "technology works", and if it doesn't work, then something went terribly wrong. But once you become a provider of technology, that perspective is flipped. Technology is broken, and if it works, then something went wonderfully right. It takes time to develop that perspective, and so young engineers will have their programs break constantly, not realizing that "broken" is the default state of the world, and in fact now their job is to make things work. Of course it's broken.