i have always thought it is far more dangerous, personally, to under budget a project, than to over budget it. If you over budget, and have good communication with the prodicer then you can find ways to reduce it to a workable budget, and when you do that the producer knows what he isnt getting. But to underestimate means there is the potential to be compromised to the point of the project not being viable, and that sounds a bit like what has happened to you.
Confidence is good, but it does not replace experience, which is why working in an experienced team, and with a mentor is VERY important. You get to see what works, and what is mission critical. And if someone suggests you compromise those critical aspects and workable time resources, then alarm bells will start ringing!
Regardless of the outcome you will have learned some lessons you will never forget, and that is not insignificant. We all make mistakes, its only a problem if you dont learn from them and remember to never repeat them. I also try to learn from others mistakes, and you will realise with time you not only learned a lesson but gained an accute awareness that will bode you well forever more.
As homework, have you worked out what was actually required to do the job? People and time? That would be a valuable thing to do, so if you are ever presented the same scenario, you have a reference as to what is required to make it work.