When a company wants to do something risky, I try to make sure I practice C.Y.A. with a well-CC'd email with wording similar to, "I believe it's notably risky to do X. I highly recommend against it. A lower-risk alternative is to do Y."
Management can go ahead and choose X if they want, but at least you've documented that it's against your recommendations.
Some people simply enjoy blaming and pointing fingers, and will jump at the chance to do so. (Sometimes there's also sticky politics behind it that a techie isn't made aware of.)
And don't expect outright apologies. Many people really hate to admit they are wrong. Humans are just that way. The best you can hope for is that they respect your opinion more in the future because your prediction turned out correct and theirs flubbed.
Carnegie's "How to Win Friends and Influence People" is a great book on office relationships and human nature, even if it's a bit disturbing in places. I highly recommend all geeks read it. It should be required reading in college.