I've been practicing this piece for a while now and I just feel totally empty inside. I'm practicing measures and I feel like I'm not making any progress. I can play it with a slow speed but I feel like I'm not really improving at all. It's a feeling that's really hard to explain. You know when your teacher says you have to practice one section until you master it then move on to the next section. But I feel like no matter how much I play the section I feel like I could mess up at anytime or it's just that it's in muscle memory and I don't really feel like I understand what I'm playing at all.
I have a few suggestions.
Drop it and play something else. Some_Guy's advice of playing something else is really sound. However, the worst thing about doing this is feeling like a quitter or that you've found a mountain you're not capable of climbing. My thinking here is that there are some pieces -- or even composers! -- that are just not compatible with us. Its not a matter of talent or artistic ability; they just don't click. Accept it and move on and don't worry about it.
HandWrite the piece for yourself. I've found that tricky passages can sometimes be overcome by writing them down by hand. In doing so you can sometimes find hidden relationships that make it easier to conceptualize the passage and thus make it easier to learn.
Re-write passages in a different key. There are keys and families of keys that I'm comfortable in and others that are not intuitive to me. For example it would probably be easier for me to learn a piece written as C#-F#-B-E than D-flat - G flat - C flat - F flat. The notes and chords just make more sense to me when written as sharps rather than flats... even though they're the same notes. Yeah, its silly, and no, I have no explanation for it. If the piece you're working on has a key relationship you're not comfortable with or which doesn't make intuitive sense, consider re-writing it OR write in chords you're more comfortable with on top of each line of the score (for example, if a measure is in D-flat->g-flat, write "C#" and "F#" above the appropriate parts of the measure).
Play something else.
I wish someone had given me this advice when I started out. My first instrument was the flute, and I used to practice the piece my teacher had given me, whatever that was. And, especially before exams, sometimes I would play the same thing over and over again until I sometimes actually felt like I was getting worse, not better.
For me the key is, when reaching that point of saturation, to just play something else. Variety is the spice of life. Unless there's a specific reason you need to play this piece right now, I'd even recommend leaving it for a week or two and playing a lot of other music. Play some old favourites of yours, and even better, pick something new to get completely consumed by. With any instrument that I play, I often find my usual path for particularly challenging music now is that I'll practice it and practice it until I'm absolutely exhausted with it and no longer making that much progress. But when I come back to it in a couple of weeks, I'll be starting from a much higher point, and can starting building up from there.
You've described a feeling I know well: in my opinion, once you just feel like you're "going through the motions" rather than actually understanding the music as music you should give it a rest, and fill that space with a wealth of other music.
This is my personal approach of course, but it works very well for me.
Try looking at it from different perspectives, and playing through using different articulations. It also helps with hands separate practice with strong and firm fingers. Musically, try to give yourself an image of the piece. When I practice, I often ask myself what the piece is about and I try to put myself into a situation where I can "experience" it. It also helps if the piece has some kind of "story" behind it. Getting into the mindset of the piece is pretty important.
You say you're playing a passage and it still feels like it's going to go wrong at any moment. I'd suggest trying to identify those points within the passage that it usually goes wrong, then ask yourself why it goes wrong there in particular. For instance, you might be changing fingers to start a new run, but starting on the wrong finger and then the run goes wrong. Or you have a big leap, or are jumping from one tricky chord to another. The list goes on.
Once you've identified the potential crunch point, construct a 'region' that starts a beat or so before, and ends a beat or so afterwards. Practice that region, so you're intensively practising correctly stuff that often goes wrong.
As a pianist I find that most music contains these moments of potential crisis, and if you can identify them and practise them correctly, the rest of the music falls into place around them.
You also mention not understanding what you're playing. With your musician's forensic hat on, see if you can spot the structure in what you're playing. For instance, the opening theme may appear later on in some other form. See if you can describe the piece in words - a musical recipe that would give someone else an idea of how the piece goes.
One thing that used to help me during college was to actually focus on adding in as many additional attributes to the passage as possible. What I mean by this, is focus on the articulation for each note, the voicing, dynamics, how you are using the pedal, what the harmony is or is implying, etc...
Initially this seemed counter intuitive to me because I felt like adding more things to think about would overwhelm me, but it actually seemed to engage different parts of my brain and made memorization and execution of the passage substantially easier/quicker. It is as though your brain finds the piece to be more interesting when you add in these additional dimensions which helps flatten the learning curve.
I also used to quiz myself by picking a random measure (or sometimes beat) to start at, mid passage, to help break some of the muscle memory cycle. If you have the piece memorized, open the music, pick a measure in the middle and set yourself mentally for how you will start from there, and then close the book and see if you can complete the passage from your chosen starting point. Along these same lines you could try playing the passage one measure (or perhaps multiple measure, but not the whole passage) at a time from memory, stopping each measure and taking your hands off the keys and resetting for the next measure.
rewrite the score several times on paper and software, transpose to the other keys and play it or just realize that this music will not bring you fame and glory and never give just a minutes of joy, don`t play it if it is not a masterpiece. Play only masterpieces and music you really love, do not spend and waste your time and health on bad sounds. And read classical books on overcoming technical difficulties like Alfred Cortot and Hoffman wrote.
Run over the passage slowly BUT CORRECTLY a few times. This is the main point that many students fail to grasp. Slow practice must be perfect. If you fluff it when playing slowly, you'll fluff it worse at full speed. Turn on that metronome (yes, you have got one, if only a free app on your phone) and play it slowly but with no hesitations or mistakes. Then do something else. The benefit will show up in tomorrow's practice session.
practice something different or an older piece you‘ve learnt
enjoy the progress you‘ve made
Transposition to C major makes you understand better the function and chord progression (written or playing by heart)
Play variations of the rhythm (dotted or syncopation)
make reductions of the motifs and passages
practice the piece from the end backward (measure by measure) by heart and by ear.
invent etudes of the passages
try out another fingering than the given
make a leadsheet with the chord of the piece or wrie the chord above the staff
write out just the fingering of a difficult passage and practuce it every where without the piano (mental training)