There's been huge improvements in automating maintenance, and yet I've never once heard someone blame a layoff on e.g. clang-rename (which has probably made me 100x more productive at refactoring compared to doing it manually.)
I'd even say your conclusion is exactly backwards. The implicit assumption is that there's a fixed amount of engineering work to do, so any automation means fewer engineers. In reality there is no such constraint. Firms hire when the marginal benefit of an engineer is larger than the cost. Automation increases productivity, causing firms to hire more, not less.