All too common
I've had my code rejected due to high failure rate - about 1% due to out of legal range input data. Only for it to be replaced in the long run with nearly 100 entry clerks printing out the electronic forms and double entering them and achieving a 5% error rate. An empire was wanted by the commissioner and had to tell some massive porkies about my code which had far exceeded their expectations and spec!
Another bit of code solved a commission anomaly which meant sales could work with customers to get orders of (say) 10,000 items and then return 9,995 of them and still get the commission for 10,000 items. Turned out their bosses got a large commission based their staffs commission so fuck the shareholders.
I've found many projects held up for patently spurious reasons and being able to write sql and with access to the various DBs its never ceased to amaze me the level of hanky panky going on above my pay grade. I've always felt it best not to delve too deep or point the finger too directly as people who do this can turn very nasty. I could have been very rich if I could have exploited some information I've had - or been marched out in handcuffs unable to prove my case once out of the building so I'm never quite sure whether it was cowardice that stopped me doing something though in most cases a lot of people other than myself would have been out of work for no fault of their own.