When working in a team, personal results are not good enough. Great work can be frowned upon if you don't think about:
You say, "I started staying late in the office". This was not a marathon-session where you banged out a quick tool in a late night at the office, it was a continued effort that gave you ample time to let people know what you were working on.
What if someone else was working on a different solution? What if there were other priorities that merited your time? What if there was someone who could have helped you out?
Having side projects is great. Learning on your own is great. But if you are planning on creating something usable, you need to let people know (particularly your boss) to prevent duplicated effort or from treading on any buried political landmines.
Once you have let people know what you're working on, you need to get their input to make them involved in the process. People are far more likely to support something that they were asked about than something that was pressed upon them without a choice. Once something has been finished and presented, it becomes far more difficult to change it.
Often it is much easier to work alone without feedback. The problem is that unless you know what everyone wants and can present something that entirely satisfies everyone1, it is easy to be a naysayer and cause road bumps further down the line.
1: This is known as the impossible dream.
You don't have to implement every piece of feedback you get, but you do have to at least make a gesture that you are trying to work with the team on it.
By telling the team what you are doing, and by giving them a chance to get input, they get ownership over the results. When you get credit for the success of something, you are far more likely to fight to get it to succeed. By giving your coworkers some of the credit for the output, you make the output far more likely to be accepted and benefit the company. And that is the goal, right?
So after you've told your team what you're doing, and gotten their feedback on how to make it better, you need to focus on making them feel like this is their project too.
For your particular situation, here is where you slipped up on each step.
You didn't tell anyone you were working on it until it was finished (and then only told your boss).
You asked for approval from your boss before even running it by your coworkers to see if they approved (despite them being the ones who are responsible for that functionality).
You were going to present to your management and your team at the same time, making it seem like this was 100% your idea as your team would be hearing it for the first time too.