Practice doesn't make perfect, practice makes permanent. If you want to play a passage accurately, you must practice it accurately, every time. But how? Here's the first of several tried-and-true techniques for reliable performance in intricate passages.
Start with the LAST measure or finger pattern of the section that's bothering you.
Play left hand to the end of the section (if you're on a keyboard instrument. Any other instrument, just start with the last pattern of the passage). This is the time to finalize your fingering, get the notes right, polish intonation, add articulation, everything. Keep it slow enough to be easy, and stay with it until it's steady, not necessarily up to tempo (that tip comes later). Repeat until you can do it 3 times in a row correctly, with no false starts. Just nail it, 3 times IN A ROW. No cheating!
Then, go back ONE measure. If the measures are long, with lots of problems, go back just a half measure, and play to the end of the section again. Same rules. Stick with it until it's correct 3 times in a row.
Continue working backwards by measure until you can play from the beginning of the passage 3 times in a row absolutely right, every single time.
For keyboard players, now start again in the LAST measure with the right hand part. Do the same process again. When that is mastered, go back again and do it again, with hands together.
Once the passage is correct time after time, then go back 2-4 measures and "get into it". You may have to practice "over the hump" the same way, as you stitch the section to the body of the piece.
Don't get discouraged! The brain is not a list-maker, it's an integrater. Think of three children holding hands in a circle. Then another child joins the circle. Every child must adjust a little bit to accomodate the new child. That's what's happening when you add a new bit. Errors will probably occur nearly every time you add new material. That's the brain processing two pieces of information into one solid chunk of ability. It can be frustrating, but STICK WITH IT. The integration process makes the learning completely solid IF you keep at it long enough to get the whole section 3 times IN A ROW right. If you do, you will be able to rely on your fingers to give you the passage every time. If you don't, I hate to tell you, it won't work.
First, as we add on sections, we're always playing toward familiarity, rather than away from it. Second, we bypass the red flag at the beginning of a hard part that tells your mind, "Oh, I'm playing that hard part again!". In effect, we fool our minds into not paying attention while we play a "nonsense passage". The mind leaves the task to the muscle memory to work out. Little by little we work our way back until we reach the front of the passage. Then there may be trouble hooking that part back into the rest of the piece, because our mind insists on thinking there's still a red flag there. So we have to spend some time backing up into the rest of the piece. Little by little, the red flag disappears, and we sail through the passage.