No one is saying that experiances don't change you, but if you were against doing A, and an experiance changed your mind so you didn't mind doing A. Fine. Just don't go back to be against A, then in favour of A, then against A.
For example in ST if you believe that the PD should be upheld despite your circumstances, fine. If an experiance changed your mind to never mind the PD I'll do whatever it takes, fine. But if you are flip-flopping bewtween the two then there is an issue.
I would also expect starfleet Officers esp. those that have acheived the rank of Captain, to have had training not to act irrationaly based on some personal problem.
Actually, if you look at shows like TNG, you will see a lot of flip-flopping regarding the PD. It has to do with the argument that the PD is probably not as solid as one thinks it to be.
With that, notice that complexity of behavior extends even to circumstances. For me, that's what makes stories well-made.
In any event, don't confuse consistency with the creation of cardboard cut-out characters.