I have seen just this happen. I don't know how someone as basically incompetent as my former boss could do it, but he was made an IT manager for a huge government department, in spite of the IT department at my workplace having the worst reputation in town.
In the case of the guy I worked for, he was charming in half-hour increments and technically decent, and good at seeing new project opportunities. But bad at planning, sharing credit, and basic decency.