You did what seemed right to you at the time but you had an inadvertant whistle. I can admit it, and I think most everybody else who posts here can too, that I have had a couple before. Some of us just get whistle happy. Normally it is because we are new to this. Others come from trying, too hard at times, to get the play stopped as quickly as possible to avoid the late hits.
One thing that really helped me was to get my whistle out of my mouth during the play. I hold it in my mouth until the ball is legally snapped. This way I can get the dead-ball fouls and stop the play. Then I take it out and hold it in my left hand. I flag and bag with my right. Then when the ball becomes dead I put it back into my mouth. If it is never in your mouth while the ball is live then you are less likely to blow it inadvertantly. I never liked just dropping it from my mouth during the play as it was hard to find later, I like to hold it.
When you blew your whistle the ball became dead. The team in possession of the ball at the time had the option of taking the results of the play or replaying the down as if it had never happened. I'll give you three guesses which the defensive coach would have picked.
Just keep at it and don't get discouraged. We all make mistakes. It is just how we learn from them that is the important thing.