Hmm... have you seen a doctor abut this? Does your knee lock up at any other time?
Could be indicative of a problem with your muscles or joints lining up properly, or incorrectly engaging certain muscles (which I sort of doubt, considering you're working on full inverts, I would hope you don't have any imbalances!)
My suggestion would be to try to do it really, really slowly. From the floor, if you have to, in order to find the problem and see if there is a way to get around it. Doing it slow will give you an excellent indication of exactly when and where the issue is happening, and what it feels like when it does happen (you'd be surprised, we can often tell if it's bone or muscle, or something else!), and whether or not you can use a certain amount of twist or different muscles to prevent it.
Though, I would recommend going to a doctor also. Knee troubles are something I'm fairly familiar with... and I would rather you catch it early and not have to go through lots of pain and frustration!