Hello! Yes, it is a weird situation. When i was younger, I used to hear all the time "if you were a bit older", not that I am a bit older, they are looking for younger people! But sincerely, I think all of that are just excuses for them to employ whoever they want, for whatever reason they want. Some want younger so they can claim they are inexperienced so they can pay them less, etc etc.I am sorry, I would like to share my opinion with the dear @GreyCat. Belarus has a similar economy (judging by its GDP and world rankings). We are also in decline in the real sector of production, but information technologies are developing. However, finding a job in IT is difficult. As wrote above @Ant22 , you need to know the full stack of technologies. This is not always possible, since it takes a lot of time to study at a level sufficient for the employer. At the same time, I faced the problem of age when looking for a job. In our country, many employers are looking for young (20-25 years old) workers. Finding a job at 40 is already quite difficult in the IT sector. It seems to me that with your ability to work with complex equipment, it might be easier to develop your own product (device) that could be useful to others. Accessories, measuring or calibration tools are possible.
Perhaps it would be worthwhile to organize a training course (online) in your direction. After all, you are a professional in this area. And consulting for a fee would be faster than learning a programming language and trying to start from scratch, competing with established specialists. While you can certainly also explore Java, php, phyton, c++ (Although this programming language is quite specific. My cousin is a professional programmer. Has inconsistent small orders, living in St. Petersburg, because development on it is expensive and time-consuming. And many customers recently want to quickly, inexpensively, and find a number of other solutions, albeit not with low quality).
By the way, if you know AutoCAD and similar software packages well, you could try to pass officially for a certificate (if you don't have one yet - aci.autodesk.com) and become a professional trainer. Services of this kind have always been recovered in the design and engineering calculations.
Your idea is a good one. I was thinking more of a online course of how to work with CNC machines - theoretical parts, introduction to materials, tools, work holding, basics of working with a CNC machine, G code writing, technical standards etc. That is a big project but it might be worthwhile, who knows. I really cant fathom at all how big or how low of and audience willing to pay for something like that I would have, but probably it could be a sizeable chunk. I used to hold two to four week training sessions for CNC operators and CNC programmers for turning, milling, punching, laser cutting. I had about 5 to 8 persons in each class, for the duration. We had all from theory to running and working on the machines. Maybe online training might be at first theoretical only and later maybe I could film some of the workholding, setup and operational procedures on the machines. Thanks for the idea!