The piriformis muscles and their accompanying nerve complexes are large structures in the body. The nerves are quite delicate and subject to inflammation. They attach at your lower back vertebrae (around L-4 and L-5) and run down through your gluteus maximus (your buttocks), around your hips, the front of your thighs, towards your groin area, and finally down behind your knees to your feet. If you have received a back injury that caused compression of the nerves intertwined within these massive muscle groups, you might be experiencing pain. Some people are born with the nerve roots running parallel with the muscles themselves, thereby not experiencing a lot of pain due to compression. Some people are born with the nerves piercing the muscles. Even the slightest disc compression could cause pressure and resulting pain. In some patients the muscle "turns off", resulting in unusual muscle weakness and muscular atrophy also know as Sciatica.
You have just performed the "piriformis stretch." You should feel a strong stretch in your hamstrings, buttocks, and low back. This is normal. It will get easier and you will be able to do more and for longer.