I really have to disagree with your teacher here in pushing you towards another comeptition with the same piece. Practicing one piece, the same piece, for hours upon hours for days upon days really isn't good for your musical development. I think it's one of the best ways to drive yourself into a mental hole. A mental hole is much more difficult than a technical one to climb out of.
The most important thing to do is grow musically, grow in technique and conception. You're 17, you're young yet. You have plenty of room and time to grow. Don't fixate on the fact that you lost. It's worth asking yourself honestly once why you lost. You may or may not have an answer. If you do, then congratulations, you've identified an area for improvement.
But if for God's sake you can't imagine why you lost, which is probably why you're still losing sleep over it, then simply don't worry about it anymore. My wager is that you have genuinely reached the limit of your conception of the Etude, and it isn't going to get any better until you study other pieces, use them to grow musically. Lay the Etude aside - you can always come back to it later if you ever feel like it.
To drive this point home, consider this possibility. You sink another month or two into the Etude and you make a few changes, but don't make any discernable overall progress. Then you go to the other competition, and you win. Would that be satisfactory? No. You would still have the doubt of why you lost the first time. And meanwhile you have sacrificed months of potential growth.
Success is stochastic. But excellence is procedural. It's clear that you have the dedication to work hard and succeed. But you must make sure that your work makes you grow, and not become bitter and stagnant. As long as you keep growing, it's only a matter of time before you succeed.