mmmm - there is "wrap your leg gently around the horse" and there is "cling like a klingon/limpet" !
If you are gripping with lower leg and not knee, then it is possible you are turning out from the hip, which will take your knee *away* but bring your lower leg (calf) right on. The problem with this is that the calf muscle in this position is all bulked out and not particularly easy to use with finesse...
Try it sitting on a chair - sit with feet flat on the floor and knees pointing forwards. Now turn the leg out from the hip (turn your toes out wide like a ballet dancer but without it being through the ankle). Now pull your toe up.. and see what happens to the calf
You'll see that perhaps like this - putting weight into your heels could give exactly the opposite result to the one you desire.
So: first off check that your feet are actually sitting in the right place in the stirrup. You would be amazed (I was when someone showed me this - and I'd been riding for 30 odd years at the time !) how something simple like that unbalances the whole leg, and hence the rider. The stirrup should be under the broadest part of your foot. Your foot has 3 points of balance - one in the heel and two across the ball (widest part). When you ride, you lose the balance point at the heel so you *must* have the other two on the stirrup..
You may find this is enough for all the leg joints to ping back into alignment..
but if not, go back up to the top and check what is happening at your hip and seat bones. You need to be able to open the hip so the knee can come towards the direction you are riding in