BartK You see, once I can "play" the piece through I get to a stage where the immediate gratification of being able to play the piece is over and all that remains is only the hard work to make it sound less crappy. But as I work through the sections if I occasionally play the piece through it still sounds crappy and that is demotivating.
On the other hand, I know that given enough work I can get even very difficult passages to a decent level because I have done that with Chopin etudes - playing only exerpts and treating them purely as exercises without having any intention of learning the whole piece. If I dissociate each small section from the whole and just treat it as an exercise that I work on for whatever time it takes to make it good then it seems I can achieve some progress. I'm testing out this approach on some pieces right now although I don't know if it will scale to larger works.
My sense reading this thread is that you need more time to cook, so to speak. You can learn demanding excerpts well, but only through a lot of focused work, and each small section takes a lot of time and effort, so it's difficult for you to continue through an entire long piece this way, yes? When I read this, I think that probably you are taking on pieces which are, overall, too technically demanding for you - being capable of learning and executing a short technically demanding section is different from comfortably (and comparatively quickly) being able to execute many technically demanding sections over several pages.
When I ask a student to push the envelope briefly (in a non-piano-related subject), and they are successful, I don't say, "Great! Now do it 10,000 more times today!" Instead we return to the baseline at which they can be reasonably quickly successful, to firm up even more skills which are already pretty well internalized. Perhaps in the next lesson we might again briefly attempt something at the higher difficulty level once. Over time, the amount of time that a student has to sustain that higher level increases, but it becomes easier for them to do, because they have been gradually building up that stamina. But never too much all at once, because it's just too much - when it's too much of a grind, or requires too much intense focus for too long, the mind and spirit checks out. Which is what I think you're running into.
Can you find long-ish pieces which you enjoy, which are generally a significant step down in technical demands from the long pieces you're currently taking a long time to learn, but which still have (only) a very few demanding sections? If so, I would spend a lot of time learning several of those, at a bare minimum. I think you will find that doing this will teach you to learn each demanding section faster, so that eventually you'll be able to learn the long pieces you're currently attempting without spending so much time on them.
My suspicion is many students without a teacher tend to try to move too fast, and they run into trouble as a result. Certainly that's something I've been repeatedly guilty of. 🙂