I wonder to what degree malice can be engineered to look like incompetence?

Try examining the old entries from the https://en.wikipedia.org/wiki/Underhanded_C_Contest.