In my experience of learning anything, lessons are generally not where you enjoy yourself! Lessons are where your teacher pushes you to do better, to refine your technique, or to develop new skills. This is always going to be relatively hard work, and sometimes you're just going to be less able to process this.
Remember too that playing a musical instrument has a mental focus component and a muscular component. Sometimes you'll have sharp mental focus, and sometimes you simply don't - perhaps you didn't get a good night's sleep, or whatever. And sometimes your body will be on your side, and sometimes it won't - perhaps you spent the weekend digging in the garden and now your hands and arms ache. Or maybe there's no discernable reason, and your mind or body are just having a bad day! These things just happen.
When you're on form mentally and physically, then you're working at peak performance. If one fails, then you might find you know what notes you want to play but you can't quite get them down right, or your hands might be working but your mind goes blank. And if both elements aren't on form, then everything tends to go wrong. If this happens during the week then it's just a blip, but if it happens to coincide with a lesson then of course it's more prominent.
This is the realisation I had a few years ago when I started getting more serious with guitar. Some players were clearly so far above me - but some players on the folk music scene were no better than I was but were still getting regular paying gigs. What became clear was that whilst they weren't better players than I was, they were more consistent players than I was. With the level of practise they did, they simply had fewer "off" days, and their "off" days were less intense.
You've only been doing this three years. You've probably got reasonably good by now, but you're still going to have "off" days, and you don't yet have the ingrained muscle memory to carry you through them.
My best advice if you're having a really bad time of it is simply to stop. If you're getting frustrated, you aren't learning. Your technique is probably suffering too so what little you're learning is most likely wrong. Worse though, getting frustrated on an "off" day can ruin your enjoyment of playing. If you can take that step back, realise you're just not on form, and pick up again tomorrow, you'll quite likely find it'll all be better tomorrow - and that you still love your instrument.