Going forward, make sure that expectations are clear. Particularly requirements! Make sure you have requirements spelled out, on paper, over email, in planning documents. Make sure you point out when requirements change, and do it over email or paper, or some durable medium. Don't let situations get murky and rely on faulty memories. In short, try to be the organized, rational, delivering engineer that puts in good work and reliably delivers. If your management doesn't have the attention span or organizational skills to spell out plans and requirements, then it's going to be on them when failure occurs.
Things not being on time is almost always management's fault. They set timelines. They set expectations. They have the power and make the decisions. As long as you are giving them good estimates and delivering, it's definitely their fault if things slip.
edit: I will add that you don't need to keep what you are working on confidential. Talk to your coworkers and friends about your technical challenges all the time. Just don't bad mouth your project or your manager.