I'm not a teacher, but I kind of see a different view of the situation. If you are teaching a beginner, I would think it would be better to start over (maybe not the whole song, but a little before the part that they messed up on). As you are just starting to learn, it would be good to find out what you did wrong and correct it right then. Rather than just forget it and move on. If you keep going, you don't really learn what you messed up on, or why, or how to correct it. Worst case scenario, you always mess up on the same part and may even pick up some bad habits if you just move on. Beginners are learning the basics, so teaching them how to play the right way is obviously good.
The real life situation of not being able to start over is valid, but I would introduce that when they are more "intermediate" and not making minor errors anymore. They should already know the basics by now, so playing through their mistakes is less of a hindrance to their future performance.