It's not even the last ball, when I am in line for an easy run, I miss the easy shot complete the run.
The cause for this is simply lack of focus. It could be due to the pressure you are feeling to run out the rack and that is in your thoughts and keeping all of your focus from being on the shot at hand, or it could just be that you are simply taking the easy shots for granted, not fully bearing down and giving them the same focus, which is a cause for misses of easy shots in all players, including pros.
Both losses were because I missed the last or second to last ball in every game. And the shots I made to get to those last balls were harder than anything I missed.
Play a tough shot with tough shape, get where I need to be, then miss.
Something else to keep in mind is that you are at least 3 times more likely to miss your next shot after just having made a fantastic shot than you are if your last shot was more mundane. The reason is because you lose focus after a great shot. Whether you realize it or not your mind is focused on "holy crap, I can't believe I made that, that was a great shot" or "way to go, wow, you hit that like a champ, pats on the back for that one" or even simply "whew, what a relief, I was worried I was going to dog that one, sure is nice that I made it or got there with the position and won't be turning over the table to my opponent". Whenever you make a fantastic shot you always have to take a few extra seconds to "let go" of the previous shot and move on past it and are ready and fully focused again for the next one.
A few other things that might help with your issue of missing the last couple of balls, some of which has already been mentioned:
Play shape on the 9 ball too (or whatever the last ball is depending on the game). This helps to keep the same type of rhythm and focus that you normally have. But instead of playing for super tight shape just play for something that isn't too terribly tough or precise. Maybe play for the middle of the table, or play to hit the middle diamond between two pockets, or something like that because you want most of your focus on pocketing the ball.
After a while your mind may have started to subconsciously associate the 7, 8, and 9 with pressure. One way to deal with this is to play 3 ball, but use the 7, 8, and 9 as the three balls. Break and run out, over and over and over. You will stop associating those balls with pressure, and will stop feeling the pressure simply because of the number on the ball. They will start to become "regular" balls again, just like any others. Heck, you can even play 3 ball the way you play the ghost, with ball in hand after the break. Or just throw them out on the table and start with ball in hand. The point is that you want to run them out without feeling pressure so you can break that association. Later in real 9 ball games once you are down to the 7, 8, and 9 left on the table you can even tell yourself that at this point it is no different than one of your 3 ball runs you practice with the 7, 8 and 9.
Another thing you can do to break the association of the 7, 8 and 9 with pressure is sometimes when you practice 9 ball, rack the 9 ball up front and the 1 ball in the middle. Play the 9 ball first, as if it is the 1 ball. Play the 8 ball second, as if it is the 2 ball, and play the 7 ball third, as if it is the 3 ball. Obviously the 1 ball is played like the 9 ball and is shot last, the 2 becomes the 8 ball, and the three becomes the 7 ball. I have heard that this has helped some people to stop feeling the pressure when shooting the 7, 8 or 9 in real games because they start to see them just like any other balls.