We have been using objects of the kind described in your last paragraph, called compilers since the 1950s, and with the increasing number of portability-focused high-performance DSLs / frameworks like tensorflow or OneAPI, we are only going further down this direction. But yet 70 years after the advent of compilers, there are still people who know how to open-up the machine, improve it, and fix it, and there probably always will be.
I don't see how machine learning, at least in its current non-AGI state, will be any different. It's just that your average end-user will have no idea how to "open up the machine", but that's also true for compiler technology today.