That's a good point. I took a closer look at the hub, and after subtracting half the thickness of the key, I'm not sure there's enough "meat" left for the screw. The drawing actually shows the key and set screw placed 180 degrees apart, but I don't like that because the burr left by the set screw can make if difficult to remove the gear.You have to be careful about putting the setscrew over top of the key.
Make sure that the hub is thick enough, where both the key and setscrew will be.
For this application (camshaft), I wonder if it would be sufficient to omit the key, and just mill a flat on the shaft for the screw to bear on. I wouldn't think a camshaft gear would be subject to the same loads as a flywheel on a crankshaft. Thoughts?