There’s nothing wrong with stretching and strengthening your hip flexor but, you may find that you’re also chronically contracting it.
It’s very common to over-recruit one hip flexor and close off on side of the hip taking away extension of the rest of the leg to an extent and overall normal movement function. Watch the video and hopefully it give you some insight into part of this nasty movement that can sneak up on many of us when we start “hiking” or over-recruiting our hip flexor typically on the drive leg of the javelin throw..