I've literally experienced this exact gut reaction two times in the last couple of months at two different companies. Code that is working fine, might need a bug fix here and there, is deemed worthless and should be rewritten. These we're tiny dev team: 3, 4 people max, so it happens everywhere I guess.