If your morality is derived from other people or stories, you are on shaky ground.
When you actively reason through an ethical dilemma rather than simply adopting rules handed to you, your moral convictions tend to be much stronger and more resilient.
Psychologists and philosophers often describe this as the difference between autonomous morality (internalized principles based on your own critical thinking) and heteronomous morality (following rules out of fear of punishment or a desire to please authority). When you reach your own conclusions, you truly own the underlying values, which makes you far more likely to act on them consistently, even when it is difficult.
