Hard to know what is giving you a problem but check out this Lisa McCormick video at the 3:00 mark. Note her wrist position change when she plays the barre chord. I know when I tried my first barre chords I wasn't moving my wrist into a proper position. I went extreme at first throwing my wrist out in front and then brought it back in once I "got it". (Too extreme would cause me pain).