If you aren't yet used to playing with a metronome, the added information that you must respond to while playing can overload your brain, leading to mistakes.
Often when players start to practice with a metronome they find that their time isn't as good as they thought it was. When playing a familiar piece you may find that many small adjustments are needed to keep in time; this new cognitive burden can distract the player.
One way to improve the situation is to practice tremolo picking with the metronome. Set the metronome to a comfortable tempo (e.g. 60 bpm). Fret any note, or play any open string; it does not matter what note you play. Match the tempo with quarter-notes, alternate picking on that one note. Work on this for a few minutes until it is smooth and in time, then work on playing eighth-notes in time until this is smooth. Then play eighth-note triplets, then sixteenth-notes, then sixteenth-note triplets. Next, increase the tempo (say, 70 bpm) and start over with quarter-notes, eighth-notes, eighth-note triplets, etc. Go through this exercise, increasing the tempo slightly each time you start over, until you can't keep up any more.
This exercise is useful because it allows you to focus on your picking and on your time, on interacting with a metronome and making corrections, without other distractions. It also helps you to identify the tempos at which you will meltdown. Keep notes on which tempos you use and how far you can go without losing control. You should notice an improvement in your ability to lock in with the metronome quickly, and playing familiar pieces with the metronome set at different tempos should then come easier.
This is a good warm-up exercise for when you begin a practice session. You can extend it by adding 32nd notes, 64th notes, 5-note groupings, by starting with sixteenth-note triplets and working back to quarter-notes, etc.