The body allows you to be flexible to the extent you can handle those positions. Trying to power through a strong pain signal is your body saying you couldn't handle the responsibilities of that position. e.g. being able to get into the position but not out.
Painful stretching is a sign you're doing it wrong, that you've missed something fundamental. Only when you shore up that necessary knowledge will the path open to you effortlessly and painlessly.