Here are my top ways to fail as a technical manager:
1. You don't understand what the people who work for you do well enough to know good work from bad work. This has all sorts of bad ramifications. You can't be a leader if you don't understand what's going on. Does that mean you should be able to write code? Maybe. . .it depends on the job. It does mean that "Don't write code" is not universally good advice.
2. People don't trust you. This might not be because of anything you've done but things you've failed to do, like chat with people regularly and give them bad news quickly.
3. You don't manage the careers of subordinates so that they feel like you're helping them succeed. This is particularly important for the typical engineering personality type that finds "selling yourself" repulsive. Don't have enough data to "sell" a subordinate at review time? See #1.
4. You don't set a goal or direction. Details are the engineers' job. You have to know about the details and understand them, but your job is to give a clear overall direction and goal and help the team stick to it, and change it when necessary. If you've hired good people who want to accomplish something, they'll do that. Just make it clear what that is.
5. You forget that your success might occur in spite of you. Especially as a middle manager, you're like an insurance company; if there's anyone on your team that causes that team to be a success, you look like a success. A mostly dysfunctional team (or a completely dysfunctional manager) may still succeed. Understand that great people risk a lot more working for you than you risk having them work for you. If you're successful, you should live in fear that you're doing everything wrong and constantly check yourself. You also need to hide this fear from everyone.
6. You don't live to serve. Your goal every day should be to give your people the tools they need to succeed.