Another thing, and this one will sound weird and I'm sure someone will want to argue the point, but it's true. I worked in a complex industry and became a technical trainer, liked it so much I went back and got my degree in advanced adult education, so I do have a clue here.
Learning is very condition and setting dependent. You learn best under the same conditions as you practice. That's why simulators are so important in today's high tech world, that's why standing when practicing is actually important; same with using your mic if you sing, etc. The same for practicing it the correct way only. So.....
So when you play this song, is it possibly after a couple of beers or substance of your choice? In a later set when you're tired, perhaps? If you have a couple of beers when practicing and learn it then, it'll make it easier to repeat it back under the same conditions. Yes, a couple of beers will START to impact your playing, and maybe that's why you repeat the bad playing, where you might learn it 'dry' but it keeps you from doing it 'wet' when you fall back to the old behavior.
I'm sure others will jump in here and say any alcohol makes your playing worse, but that's old wisdom and not necessarily true for one or two beers for most people according to many recent studies. And I mean only one or two; at first lower levels of alcohol lowers inhibitions/relaxes before it impacts motor skills, but shortly after that many things go into the crapper very quickly. I know my playing certainly does, but a couple at first relaxes me and so I have a few and stop. (In the research results, the first one actually does the relaxing, but the second one starts the degradation of coordination. The relaxation offsets the initial degradation and comes out about equal for most people at or before the end of the second drink. After that it's all downhill.)
So if you know you're going to have a couple, do the same when you practice, at least occasionally. OK, go ahead with the flames.