Firstly, the number of people who cannot be a software engineer is not actually very large. There are a lot of really shitty software engineers out there. Unlike being a doctor or a lawyer, you don't have to pass a test that requires actually knowing material, you simply have to be able to convince someone to give you a job banging on a keyboard, which does not necessarily require one to have technical skills.
Not everyone can be a good software engineer, sure.
Among people who cannot be a lawyer, or a doctor, or a good software engineer, there are also very few people who can be a good machinist.
Competent machinists require an extremely similar set of problem-solving skills as competent software engineers.
Bolting a bumper to a Ford is different from manufacturing the metal shape of the bumper itself, and a competent machinist is the person who both figures out how to turn a piece of raw metal into a piece of bumper-shaped metal, and also the person who figures out how to do so in an easily replicable way.