Sounds familiar (not running back home, but to the car for me). All ok now though. Go back to basics, really yummy treats, practice when he's not too far away, so you're guaranteed success, then work on distance.
It will have scared you, but in time, you will build confidence up, I know I did, but it takes time.
Good luck, Sarah