Optimizing for the wrong situations is a very common condition in the modern world. Not due to any fault of the individuals who happen to do it, but because of the sheer volume of complex interlocking systems that are in existence and the impossibility to know them all well enough to avoid it.
An example is when a traveler hears about the very strict custom checks in a country they're about to go to, and efforts profusely in order to make sure everything is in order prior to arrival. Time and energy goes into the preparations, in order to optimize for these checks. Then, when the day arrives, the custom official looks indifferently at the luggage, shrugs and waves them through with a bored gesture. Not just with regards to our traveler, but all travelers passing through.
These things happen all the time. You hear something, prepare exceedingly in accordance to what you heard, only to find out that the preparations were completely unnecessary. Even though you've spent weeks or months agonizing about this one particular thing.
Again, this is not due to any particular fault on your part. It's just that you didn't know the situation well enough to know that it's not a big deal.
This will happen to you, again and again There is no real way to avoid it, other than to only do things you've already done before. Which, to be sure, is the mostest expression of optimizing for the wrong situations. -