Two points:
1. Quality fasteners are made to standards, which specify combinations of head, tool cavity, and thread diameter. For example, DIN 912 is the essentially universal standard for metric socket head cap screws.
https://www.fasteners.eu/standards/DIN/912/
If you're an engineer specing out metric socket head cap screws, they are going to comply with the standard. Getting anything different in quality is going to be 20:1 cost ratio if not more, and you may not even be able to find a fastener house that will or even can build off-spec stuff for you using proper methods.
If you insist on using the same tool size for all the different screws, you're going to compromise with some screws being bigger/heavier/uglier than they need to be, or some being possibly marginally too small, or some of both.
You might have noticed I am kind of OCD on this stuff, and an engineer. I'd waaaay rather have a quality, standard fastener spec'ed than something custom. Custom fasteners far too often are mega-fail.
Case study A: The aforementioned rail screws from Beretta. I was present when a buddy was trying to zero his 1301 with slugs and the heads popped off the fasteners, because they are made with other than standard manufacturing methods.
Case study B: The only wart on a Howa bolt-action rifle is the bolt stop screw. It is a custom-designed fastener, and it is utter crap. It has a stress riser where the head transitions to the shank, rather than a nice radius, and then, because it's turned on a lathe, rather than forged and rolled, there are circular tool marks that put "crack here" rings all around the stress riser. It can be unkittened by making a shoulder bushing sized just right for a SHCS that's made from 190ksi material with a forged head, radius underhead, and rolled threads.
2. Related to that, a lot of it comes down to what can be ordered. Most part or system manufacturers don't do enough volume on any given fastener to be direct with a standard fastener manufacturer. When you need only up to a few tens of thousands a year (or a lot less) of four different part numbers per year, you go through a fastener distributor, so you can get as many of your fasteners as possible from one source. This gives you a better relationship and a better position from which to negotiate your price. Also, fewer accounts to keep track of. It may totally be the case that, although the fastener you want theoretically exists based on the standard document, it's not actually manufactured. Or you might be able to get the length, thread pitch and metallurgy you need, but not the head form. Etc.