This is going to sound harsh, but it's not meant to, it's not a criticism, but there are two things that first of all comes to mind:
1. It is absolutely irrelevant how hard you worked on something, "the company" does not care if you ground yourself down to the bone, or if you barely moved a finger. "The company" cares about the project being done on time and with the expected quality. I've had negative feedback on projects where I worked like a horse, because, well, it was hard and I didn't know how to do it.. And I've had positive feedback on projects where I did very little actual work, but knew what to do, and so, well, had a good relax before installing the library that solved all the problems.
2. Striving to please is natural, and dangerous, again, "the company" does not care about your good intentions, they'd rather have a working product of high quality delivered in scorn, than a late project that's not up to standard delivered with the best wishes.
That was the tough parts, but try to think of them as ways to change your own mindset, to protect yourself from a lot of negativity that's largely beyond your control and won't benefit anyone, but only be to your own detriment.
That said, it sounds like a startup to be honest, the boss sounds immature if they're bummed out by SOFTWARE BEING LATE.. And they should definitely have appreciated that if requirements change, it's their problem and responsibility rather than yours (or at least your managers) and probably the polite thing for them to do would be to apologize that they made you do that work that wasn't used, and relay to you that it's totally understandable to be bummed about that, but that it does happen from time to time..
About you taking your managers advice, well, it's hard to say, maybe your manager didn't understand the problem as well as you did (or should have done) and so it might in fact have been your responsibility to push back, but again, here a mature boss would have recognized not to expect push back from a fresh, non-senior hire, and accepted this as part of the learning process.
How to proceed ?
If you're up for it, maybe arrange a meeting with your manager and boss, and relay your view of the situation, it was very well formulated, and their reaction and response will quickly reveal if that company is worth working for.. They probably shouldn't have to apologize exactly, but they should clear the air, show understanding and explain to you that it's gonna be okay. Any worse reaction tells me that they're not ready to be boss and manager.