Fairly common problem in my experience. More than once, after teaching slow flight or something similar, I've had to drag back to the airfield with full flap stuck down! Some contact or something isn't doing what it's supposed to. Remove the appropriate (I'm not suggesting that YOU do this) little circular access panel under the wing and in there somewhere lies the problem. I think an electrical contact switch needs cleaning/replacing - but don't ask me exactly, I'm not an aircraft engineer.
Regards, GT.