I wouldn't worry.
If you hired a person to design say a biscuit production line, you wouldn't typically expect that person to involve themselves in the problem of what happens if someone feeds arbitrary sewage into the line instead of good food ingredients, or attacks the machinery with hammers, or steals the ingredients from the forecourt.
You especially wouldn't expect a (typically) young and inexperienced engineer, working single-handedly, to design a machine (or an ordered factory environment) that was completely resilient to all those kinds of malicious attacks on the biscuit-making machinery. It would be the responsibility of a large organisation of people, including senior managers in all kinds of specialist functions, and reinforced by the facilities which the state provides (who provide police, judiciary, buildings inspectors, health and safety inspectors, factory inspectors, etc.).
Experienced programmers might be able to avoid the most blatant dangers and invitations to mischief, but only because they're more familiar by rote with a popularly-known list of bad practices. These are typically evangelised by public figures, who are either security specialists in the computer industry, or they are corporate managers who are themselves the most recent victims of a specific security hole. Or, like with Bobby Tables and SQL injection, a comic strip/meme that has become well-known because it is funny.
Experienced programmers are not much better than novices at analysing and solving overall security from first principles, which is a deeply expert area.
So don't be so hard on yourself.
Take for example Boeing crashes - they had a deal with a regulator. Another example is https://en.wikipedia.org/wiki/Titan_submersible_implosion where other corners were cut.
– Basilevs Mar 18 '24 at 15:09