I am almost 6'3". I have a fairly athletic stance at the table. I get my head *very* low (chin right beside cue...I'm left eye dominant so the cue goes just to the left of my chin). I used to keep my back leg almost locked and bend my front knee. Now I bend both knees when necessary as it gets my body lower and allows me to more easily keep my face up so I can see long shots better (can see the cue ball and object ball together on more shots). I make a point of keeping my back straight, rather than hunched.
I try to duplicate this stance when the ball is on or near the rail. First of all, make sure you are still standing the right distance away from the ball. Don't get too close. Although I usually bridge the cue on the rail, I extend my hand away from the rail. Basically, I make an open hand bridge, but only rest the tips of my fingers on the rail. The benefit of this approach is that it allows me to maintain my normal (long) bridge length, even when the ball is very near the rail. I have a system for forming my stance. It has become subconscious over the years. I would be happy to spell it out for you. I guess what I'm getting at is that my stance on the rail is very close to my regular stance (unless I have to jack up). So it seems if you feel "twisted" on the rail, you may be feeling a bit twisted normally. Just remember, the principle elements of a stance are these:
1) *center of vision* is on the line of the shot.
2) Hand holding the cue is directly behind your center of vision, on the line of the shot.
3) Stroking arm elbow is directly behind center of vision, on the line of the shot.
4) Stance is stable and repeatable.
If you are repeatably able to get your eyes (center of vision), your hand, and your elbow all lined up on the shot line, the rest is pretty much window dressing. You might need to borrow a friend to watch and make sure these elements are lining up, particularly when you are on the rail.
Hope it helps,
KMRUNOUT