My two cents, and you can take it or leave it...
When this happens with people I train with, it's treated and dealt with as a stress situation if the dog is trained and it's not a physical issue. A lot of people come to my trainer when something like this happens and they have tried corrections or their trainer has used corrections and it's making it worse or not getting better. I know we use different methodologies in training and have different believes as to why our dogs are making mistakes, but most dogs don't do the wrong thing when they know what to do and are not feeling pain when they do it, but I think it's something to consider.
Sorry for the frustration though. It's a bad feeling when you know your dog knows how to do something but for some reason they can't.