Wow that’s pretty crazy. I have to say many times in my career I’ve been writing a paper and realized “** there’s a bug”, and had to redo everything. But the overall conclusion never changed because the idea was grounded from several different angles(usually the pieces fit together even better). One bug might invalidate your result, but even if your code was correct the underlying assumptions behind the code could be wrong! I think the real issue was your boss wasn’t active enough in your work to make it robust to coding mistakes.