Lately I have really gotten into learning a song using a metronome and starting really slow (about 60 or so for 1/8 note) until everything is perfect, notes, hammer ons, pull offs, etc. What I noticed is that more often than not I mess up by hesitating to play a note which is bad a playing a wrong note, particularly when playing with others.
Don't bother going faster than 60 or slow until it is perfect. I am also finding that sometimes the way I play a section has to change to increase speed.
People always say how great they play at home. In my opinion, they are just forgiving the hesitations and less than perfect notes since they are so actively playing and not listening. A good argument to record yourself.